Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding updates for Quadrotor #166

Open
wants to merge 262 commits into
base: main
Choose a base branch
from
Open

Conversation

svsawant
Copy link
Collaborator

Changes:

  • Alternate control interface (attitude interface)
  • New dynamics formulation
  • Corresponding configs and models for controllers

…ckpoint in ppo.py. 4. Boolean var in ppo_sampler.
middleyuan and others added 21 commits September 16, 2024 14:21
…izier. 3. improve parallel computes for Vizier.
… logging. 3. change PPO search space. 4. make cost parameters independent. 5. save intermediate results during HPO. 6. two packages tested on iLQR, GPMPC, and PPO.
Copy link
Collaborator

@Federico-PizarroBejarano Federico-PizarroBejarano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good but I am having trouble understanding what is an addition and what is a bug fix. It seems like a lot of the changes have impacts on the other environments. Thus, I have two main comments:

  1. I would like to better understand how these changes affect the other environments, with some guarantee that they either fix or do not change their behaviour
  2. I think you've made a lot of changes to the pre-process function. I am not sure why but I think we need to standardize how it is used.

Additionally, in terms of linting, you need to run the pre-commit hooks. We should all install them so that they all run on every commit. Additionally, you have commented out a lot of code. For merging to main I think there should be essentially no commented out code: either the code is useful and integrated or it is obselete and deleted. Happy to discuss edge-cases

safe_control_gym/controllers/lqr/ilqr.py Show resolved Hide resolved
safe_control_gym/controllers/lqr/ilqr.py Outdated Show resolved Hide resolved
processed_action = self._preprocess_control(action)
return processed_action
# processed_action = self._preprocess_control(action)
return action
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a serious breaking change that would dramatically change the behaviour of the other environments. Am I misunderstanding something?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this will change the behaviour. The primary necessity was that the attitude controller needs to run at a higher frequency and is made to be a part of the preprocess function. Then, the intent is to run "preprocess_action" at the same frequency as pyb in advance_simulation.
Corresponding care is taken to correct it in cartpole.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if y'all discussed this yet but we should talk about the best way to change the preprocess function to accomodate the attitude controller then. I don't understand what the impacts of this change are yet

safe_control_gym/envs/gym_control/cartpole.py Show resolved Hide resolved
examples/rl/train_rl_model.sh Outdated Show resolved Hide resolved
Check the only line in this method and `_update_and_store_kinematic_information()`
to understand its format.
'''
state = np.hstack([
self.pos[nth_drone, :], self.quat[nth_drone, :],
self.rpy[nth_drone, :], self.vel[nth_drone, :],
self.ang_v[nth_drone, :], self.last_clipped_action[nth_drone, :]
self.ang_v[nth_drone, :], self.rpy_rates[nth_drone, :], self.last_clipped_action[nth_drone, :]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the difference? does this affect the other systems? was it a bug beforehand?

pos = pos + self.PYB_TIMESTEP * vel
rpy = rpy + self.PYB_TIMESTEP * rpy_rates
# Set PyBullet's state.
p.resetBasePositionAndOrientation(self.DRONE_IDS[nth_drone],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the drone state is set in several places. Didn't you create a function for this? Could it be used to decrease this repeated code?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's from the original code. Not sure, why it got highlighted.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. It seems you have added a function that can be used to clean up the code a lot tho, would be nice to replace all those chunks with your new _set_pybullet_information function.

safe_control_gym/envs/gym_pybullet_drones/base_aviary.py Outdated Show resolved Hide resolved
safe_control_gym/envs/gym_pybullet_drones/quadrotor.py Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants