spot_ros icon indicating copy to clipboard operation
spot_ros copied to clipboard

Merge with spot_arm urdf from spot_ros2

Open EceChaik opened this issue 1 year ago • 14 comments

IMG_20230921_100734

With the spot in the configuration seen in the above image, what follows is the visualization in rviz, with the current spot_arm urdf:

1695283940184

This pull request replaces the arm urdf with the one from the spot_ros2 repo. The resulting visualization in rviz for the same configuration is seen below: IMG_20230921_100739

Note the hand frame, which is published by Boston Dynamics and how in the new urdf it is aligned with the robot end-effector.

Fixes #143

EceChaik avatar Sep 21 '23 08:09 EceChaik

Thanks for this. Are the tf frames generated by the new URDF different to those in the existing version?

heuristicus avatar Sep 21 '23 15:09 heuristicus

Good point, I made sure to change the joint names such that they stay the same, but not the links. So the frames in this will be of different convention, e.g. arm_link_sh0 for the first part of the shoulder, instead of link1

EceChaik avatar Sep 22 '23 06:09 EceChaik

I think it is probably good to match names with the ros2 repo but it might mean that people using this one will have to change stuff in their code, which is why I ask.

heuristicus avatar Sep 22 '23 06:09 heuristicus

I understand. I leave this up to you guys entirely, I mostly made this because I wanted to see if other people had issues with this urdf for the arm, such as the one in the images I've attached.

EceChaik avatar Sep 22 '23 06:09 EceChaik

It definitely makes sense to make the switch, since clearly there is an issue with the previous version, but I will need to make an announcement to make sure people know what frames have changed. I think synchronising the frame names with the ros2 version makes sense since people will need to switch over to that eventually and making sure the urdf is the same would likely make things easier.

heuristicus avatar Sep 22 '23 08:09 heuristicus

I've updated the joint names to correspond to the spot_ros2 names (which come from the BD names), and updated the "friendly joint names" to convert to these values.

Original New Action
joint1 arm_sh0 Rotate shoulder
joint2 arm_sh1 Swing shoulder
joint3 arm_el0 Swing elbow
joint4 arm_el1 Rotate elbow
joint5 arm_wr0 Swing wrist
joint6 arm_wr1 Rotate wrist
gripper arm_f1x Open/close gripper

@EceChaik could you please check that the live joint update works correctly with these changes?

heuristicus avatar Sep 28 '23 10:09 heuristicus

Will check, though it might be next week, due to travelling for IROS

EceChaik avatar Sep 28 '23 11:09 EceChaik

I just had to do the above commit, cause the wr0 name was written as wr1. I can confirm it works fine on the spot robot.

P.S. The only reason I had changed the mass value of the virtual fixed joint 'hr0' to 1e-3 from 1e-6, was for people who might wanna use it for simulation in Gazebo. There, a link of mass as low as 1e-6 will be skipped.

EceChaik avatar Oct 18 '23 08:10 EceChaik

Great, thank you for confirming. I don't use gazebo so wasn't aware of that requirement. Did you need to use the virtual joint for anything that you were doing? If so I should probably change the mass back.

heuristicus avatar Oct 18 '23 08:10 heuristicus

This repo is not made for simulation so I don't think it matters. On the other hand, the mass value won't affect anything people do with the real robot using this repo, so I guess reverting to 1e-3 is the solution that covers all users.

EceChaik avatar Oct 18 '23 09:10 EceChaik

Could this be merged into master at this point @heuristicus? The improved arm simulation would be very beneficial to my groups research

trangml-mit avatar Dec 05 '23 21:12 trangml-mit

I can merge this but any existing code that relied on specific frames being related to the arm will not function, as per the table above.

Have you tested this for your purposes?

heuristicus avatar Dec 06 '23 16:12 heuristicus

After some more testing, I've noticed that when using arm ROS service calls with this version of the code, the calls involving the gripper have success False and some error exception printed.

$ rosservice call /spot/gripper_close success: False message: "Exception occured while gripper was moving: gripper_command_feedback"

Interestingly, at least some of the commands actually do get executed by the arm and work. The gripper does open and close when these are called.

Additionally arm stow, unstow, and carry seem to be working

$ rosservice call /spot/arm_unstow success: True message: "Unstow arm success"

Is this due to the change in the arm frames?

trangml-mit avatar Dec 06 '23 21:12 trangml-mit

I can't say whether the arm frame change is the cause. I don't think there is anything that specifically references the arm frames in the gripper command. It's possible that this is related to the spot wrapper in this repo being behind. I've never had access to a robot with an arm so haven't been able to verify the functionality myself.

heuristicus avatar Dec 07 '23 09:12 heuristicus