GithubHelp home page GithubHelp logo

Comments (4)

gmmhhh avatar gmmhhh commented on July 18, 2024 2

Thank you!

from gym-pybullet-drones.

JacopoPan avatar JacopoPan commented on July 18, 2024

Have a look at class RLTakeoffAviary (used in scriptlearn.py)

The current _computeReward is a step-wise function of the drone's z in the world frame

You can hard-code a goal position by making _computeReward return a (dense or sparse) reward computed as a function of the distance from the desired point

Note that _computeDone terminates episodes outside the cube with edge=1, on top of the world frame origin (0,0,0)

To fly outside this space, you'd need to re-implement both _computeDone and _clipAndNormalizeState

from gym-pybullet-drones.

chris-aeviator avatar chris-aeviator commented on July 18, 2024

In my RL problem I'm introducing a design that has tilting motors, where I just mind about the thrust vectoring, not about collision of the propellers (though every visual has a corresponding collision box). I extended the actionspace for two additional values (n=6), made sure to set the upper and lower limits of the joints and I can confirm I can control them by setting a POSITION inside BaseAviary and see correct rotations in fly.py).

0 degree, 0 degree

image

+30 degree (jointUpperLimit), -30 degree (jointLowerLimit)

image

+30 degree ,+30 degree

image

I now wonder how _clipAndNormalizeState plays a role here. I cannot find any call to this function, not in this repo nor in openai/gym or all github :) .

Do I append my two link positions (both can travel -30 to +30 degrees, set in RAD) that I want the singleAgent to optimize?

Would I modify norm_and_clipped inside HoverAviary (

norm_and_clipped = np.hstack([normalized_pos_xy,
) and computeControl in SimplePIDController (which I'm using in baseAviary) to include the two angles of the motor joints?

from gym-pybullet-drones.

JacopoPan avatar JacopoPan commented on July 18, 2024

@chris-aeviator

I only briefly read this message (I'm not sure why it's in this issue?).
_clipAndNormalizeState is called in _computeObs of BaseSingleAgentAviary.py (or the multi agent class)

obs = self._clipAndNormalizeState(self._getDroneStateVector(0))

It's just an extra function to clip and normalized the state vector IF a certain RL problem requires it (or can benefit from it).
It can be an identity function if you want to, you probably don't want to clip and normalize if you are using one of the PID controllers.

If you change the state vector, you would want to use computeControl instead of computeControlFromState in BaseControl (one is just a wrapper for the other to use fewer arguments).

from gym-pybullet-drones.

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.