URDF axis problem in retrieving the position
Posted: Thu Jan 16, 2020 10:05 pm
Hello everyone!
I'm new here and I'm also new as to the simulation/robotic world.
I stumbled upon this library due to a machine learning project I'm currently working on. I need to build a sort of playground in which I can train and tests my algorithms and I need to control every possible aspect of the environment (that's why openai's gym doesn't meet my requirements). I built my URDF model following some tutorials and the official reference but it doesn't work as I would expect and I would be very glad if someone can give me some tips to go forward.
The idea behind:
The first environment I'm working on it's composed by a plane and two cars. The cars are aligned on the same axis and, ideally, they should only move along this axis. At each timestep I should be able to measure the absolute positions of the two to compute distance etc.
What I did so far:
I created the model and, trying to mimic the example of the 2D biped (biped/biped2d_pybullet.urdf, provided in pybullet_data), I succeeded in constraining it on just one axis (URDF code in the next post).
The problem now is that, querying the position from my model (using bullet.getBasePositionAndOrientation(car)), it always returns the position of the fake element that I introduced just to restrict the movement of my car to only one axis.
Do you have a better or a more elegant solution to accomplish my task? How can I fix this unwanted behavior?
Thank you in advance!
edit: the perfect solution would allow the car also to follow some steep paths, hence should support the movement into two axis, not just one.
I'm new here and I'm also new as to the simulation/robotic world.
I stumbled upon this library due to a machine learning project I'm currently working on. I need to build a sort of playground in which I can train and tests my algorithms and I need to control every possible aspect of the environment (that's why openai's gym doesn't meet my requirements). I built my URDF model following some tutorials and the official reference but it doesn't work as I would expect and I would be very glad if someone can give me some tips to go forward.
The idea behind:
The first environment I'm working on it's composed by a plane and two cars. The cars are aligned on the same axis and, ideally, they should only move along this axis. At each timestep I should be able to measure the absolute positions of the two to compute distance etc.
What I did so far:
I created the model and, trying to mimic the example of the 2D biped (biped/biped2d_pybullet.urdf, provided in pybullet_data), I succeeded in constraining it on just one axis (URDF code in the next post).
The problem now is that, querying the position from my model (using bullet.getBasePositionAndOrientation(car)), it always returns the position of the fake element that I introduced just to restrict the movement of my car to only one axis.
Do you have a better or a more elegant solution to accomplish my task? How can I fix this unwanted behavior?
Thank you in advance!
edit: the perfect solution would allow the car also to follow some steep paths, hence should support the movement into two axis, not just one.