utiasDSL / gym-pybullet-drones

PyBullet Gymnasium environments for single and multi-agent reinforcement learning of quadcopter control
https://utiasDSL.github.io/gym-pybullet-drones/
MIT License
1.19k stars 349 forks source link

How to add visual targets in gym-pybullet environments? #85

Open HimGautam opened 2 years ago

HimGautam commented 2 years ago

I am using HoverAviary environment to learn a reinforcement learning controller. But I want to show a visual target (a small cube or something similar to it) to show what is the desired location of the drone. How to do that?

JacopoPan commented 2 years ago

Hello @HimGautam

something similar to what you want to do (placing 4 different objects in 4 different directions) is already implemented here: https://github.com/utiasDSL/gym-pybullet-drones/blob/7f8d7167bf0046a94259aaaf4fba7163b3ae5563/gym_pybullet_drones/envs/single_agent_rl/BaseSingleAgentAviary.py#L134

HimGautam commented 2 years ago

Hi, Thanks for replying. They are obstacles and the obstacles are meant to collide with the drone in simulation. How can I make these obstacles without physics. I mean they should appear just visually and the drone cannot collide with it or the boxes should not fall down to the ground when simulation starts.

JacopoPan commented 2 years ago

You can remove the collision shape from the URDF description of the object or use p.setCollisionFilterPair() to disable pairwise collision checks