vamp icon indicating copy to clipboard operation
vamp copied to clipboard

How to change the position of base link of the robot?

Open mohitydv09 opened this issue 1 year ago • 5 comments

I want the robot to be placed at a specific position in the environment so that I can manually build the world around it using vamp.Environment(). I tried modifying the URDF file, but it doesn't seem to affect the robot's interpreted position in the code. Specifically, I want the robot to be located at a particular position in the environment, for example, pos: [1.0, 0.0, 0.0], when I initiate it with vamp.ur5.

The PyBullet simulation uses the URDF file, so I was able to change the robot's location by modifying the origin of the base_link in the URDF. However, the vamp module seems to be using the robot's original spawn location from the URDF, despite my changes.

In the code below, I have modified the provided URDF to spawn the UR5e at the origin. Although PyBullet loads the URDF correctly, the robot_module still interprets the robot as being at the old location:

robot_urdf_path = 'resources/ur5/ur5.urdf'
sim = vpb.PyBulletSimulator(robot_urdf_path, vamp.ROBOT_JOINTS['ur5'], True)
robot_module = vamp.configure_robot_and_planner_with_kwargs('ur5', 'rrtc')[0]
curr_config = robot_module.Configuration().to_list()
collision_spheres = robot_module.fk(curr_config)

for sphere in collision_spheres:
    sim.add_sphere(sphere.r, [sphere.x, sphere.y, sphere.z])
time.sleep(60)

image

How do I make the code interpret robot at the location I want?

mohitydv09 avatar Jun 12 '24 01:06 mohitydv09

We currently assume that the robot base is at the origin, and transform the environment to the robot's frame so that this is true. That said, this isn't any sort of fundamental limitation of vamp; we will add support for arbitrary base poses for all supported robots in a future update.

wbthomason avatar Jun 12 '24 04:06 wbthomason

Okay, it would be a nice addition. Thank-you for your response.

mohitydv09 avatar Jun 12 '24 17:06 mohitydv09

Re-opening to track the feature to add.

wbthomason avatar Jun 12 '24 17:06 wbthomason

What's the status on this?

bheijden avatar Aug 31 '25 09:08 bheijden

If you want to generate your own robot (and don't plan on moving the base around dynamically), you can use https://github.com/CoMMALab/cricket to compile it into the code that VAMP uses. There are instructions in the readme.

This issue is still open as we do not support dynamic bases yet.

zkingston avatar Aug 31 '25 14:08 zkingston