heuristicus / spot_ros

ROS driver for controlling Boston Dynamics' Spot robot
https://heuristicus.github.io/spot_ros/
Other
275 stars 143 forks source link

Velocity Commands behave weird on newest Spot SDK #96

Closed EricVoll closed 1 year ago

EricVoll commented 2 years ago

I observed that the /spot/cmd_vel topic behaves super weird on the newest spot sdk. Spot would start to move slightly, stop, continue etc. Increasing the command duration from the current 125ms to 400ms mitigates the problem (but it's still not completely gone). After downgrading spot to an older version, the problem is gone and the current cmd_vel implementation works fine. Note: the problem is not the version of the python pip package, but the actual spot version.

I don't currently know which versions our spots have exactly, but I'll figure that out and update this issue.

heuristicus commented 2 years ago

It seems like it might be a recurrence of #54. At least, it sounds superficially similar in terms of the stop/start behaviour. What rate are you sending the commands at? I checked and velocity commands are already in the check for idling, so it's unlikely to be that.

Might be worth checking the details in the documentation for the velocity command we're using and see if it's changed at all in recent updates.

peci1 commented 1 year ago

We've observed weird motion when the cmd_vel publishing rate was too low. Try publishing at 20 Hz.

jeremysee2 commented 1 year ago

I've been testing the cmd_vel topic with Spot v3.2.0, found that it works better if you increase the command duration to 600ms. This follows the wasd example from the SDK where they use 0.6s command duration.

https://github.com/boston-dynamics/spot-sdk/blob/208c885d99813d02b4d78940289cf1c9d0279674/python/examples/wasd/wasd.py#L46-L49

This example uses the same RobotCommandBuilder.synchro_velocity_command proto that this package uses for sending velocity commands, so its safe to follow the same command duration. I've tested it to work on my Spot.