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

How to change the color of the robots? #29

Open
GPaolo opened this issue Jul 27, 2019 · 6 comments
Open

How to change the color of the robots? #29

GPaolo opened this issue Jul 27, 2019 · 6 comments
Labels
wontfix This will not be worked on

Comments

@GPaolo
Copy link

GPaolo commented Jul 27, 2019

Hi, I tried to change the colors of the Ant model by modifying the xml file rgba parameters, but with no luck. How can I change its colors?

@benelot
Copy link
Owner

benelot commented Jul 27, 2019 via email

@GPaolo
Copy link
Author

GPaolo commented Jul 30, 2019

Ok, thanks!

@GPaolo
Copy link
Author

GPaolo commented Aug 16, 2019

So, after quite sometime going through the code and thanks to the suggestions gotten on the pybullet repo, I found out how to do that.

I added this lines to the reset method in the walker_base_env and it works

for link in range(-1, 20): #Changes the color of the robot Ant p.changeVisualShape(1, link, rgbaColor=[0.8, 0.6, 0.4, 1])
Still cannot read the color from the xml file, but this is a "nice" workaround. If I end up managing to read and set the color link by link from the xml file, I will do pull request.

@benelot
Copy link
Owner

benelot commented Aug 16, 2019 via email

@GPaolo
Copy link
Author

GPaolo commented Aug 17, 2019

I actually just found out this pull request that they had in pybullet : #1506 that looks like would implement something like this on version >=1.8.1, but for me it does not work on version 2.5.3.

I asked them about it, maybe I am doing something wrong ^^'

@benelot benelot added the wontfix This will not be worked on label Nov 6, 2019
@CharlesXu1124
Copy link

So, after quite sometime going through the code and thanks to the suggestions gotten on the pybullet repo, I found out how to do that.

I added this lines to the reset method in the walker_base_env and it works

for link in range(-1, 20): #Changes the color of the robot Ant p.changeVisualShape(1, link, rgbaColor=[0.8, 0.6, 0.4, 1])
Still cannot read the color from the xml file, but this is a "nice" workaround. If I end up managing to read and set the color link by link from the xml file, I will do pull request.

the first argument should be the robot UID, and then the link index

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants