Coder Social home page Coder Social logo

Comments (4)

tsampazk avatar tsampazk commented on September 23, 2024

Hello @ahforoughi, thank you for bringing this issue to our attention!

The tutorial targets the newest version of deepbots that is currently not released and changes in that version cause this issue.

I will add a notice in the tutorial until the new release.

For now you can install the dev version of deepbots from here with the following command:
pip install -i https://test.pypi.org/simple/ deepbots
Note that the version is in development and some features such as the wrappers are not functioning properly.

Otherwise, you can make the following changes in your __init__ method to fix the problem using the current deepbots release,
i marked the changed lines in the comments:

        self.robot = self.supervisor.getSelf()  # Fix
        self.positionSensor = self.supervisor.getDevice("polePosSensor")  # Fix
        self.positionSensor.enable(self.timestep)

        self.poleEndpoint = self.supervisor.getFromDef("POLE_ENDPOINT")  # Fix
        self.wheels = []
        for wheelName in ['wheel1', 'wheel2', 'wheel3', 'wheel4']:
            wheel = self.supervisor.getDevice(wheelName)  # Fix

Let me know if it works for you and feel free to ask any additional questions! 😄

from deepbots-tutorials.

cwjwudi avatar cwjwudi commented on September 23, 2024

Hi,after I use your way to fix the problem,there is still a problem
Traceback (most recent call last): File "robotSupervisorController.py", line 96, in <module> env = CartpoleRobot() File "robotSupervisorController.py", line 23, in __init__ self.positionSensor.enable(self.timestep) AttributeError: 'NoneType' object has no attribute 'enable'

from deepbots-tutorials.

eakirtas avatar eakirtas commented on September 23, 2024

What's the name of your poleEndpont? The name defined in simulator for the endpoint should be the same as in your code

self.poleEndpoint = self.supervisor.getFromDef("<name>")

from deepbots-tutorials.

cwjwudi avatar cwjwudi commented on September 23, 2024

What's the name of your poleEndpont? The name defined in simulator for the endpoint should be the same as in your code

self.poleEndpoint = self.supervisor.getFromDef("<name>")

Hi, I've fix the problem, in my environment, the getDevicedid not work properly. Finally, I found that change the self.positionSensor = self.getDevice('polePosSensor') into self.positionSensor = self.getPositionSensor('polePosSensor') and wheel = self.getDevice(wheelName) into wheel = self.getMotor(wheelName).
My environment is Ubuntu 18.04 ,Python 3.7.10 , Webots R2021a.

from deepbots-tutorials.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.