justagist / panda_simulator

A Gazebo simulator for the Franka Emika Panda robot with ROS interface, supporting sim-to-real code transfer (Python). Exposes customisable controllers and state feedback from robot in simulation.
Apache License 2.0
203 stars 61 forks source link

Trajectory replacing support #54

Closed petrvancjr closed 3 years ago

petrvancjr commented 3 years ago

Hi,

regarding your Trajectory Action controller. I wanted to ask if it supports the replace of the trajectory on go without the need of stopping the execution. Replace the old trajectory by aligned new one.

If not, what it possibly needed to be done to make it possible.

It would help us a lot. Thank you for your time.

justagist commented 3 years ago

Hi, This is not possible with the current formulation of the trajectory controller in this package. The controller provided is simply emulating the behaviour of a simplified ROS Joint Trajectory Controller using the franka_ros_interface developed for controlling the panda robot. It looks like in the newer versions of ROS Joint Trajectory Controller, there is an option for trajectory replacement; I am not sure this does what you want. I am also not sure this will work with the custom action server defined in this package (I have not tested) because it was not originally designed to do this. Also, note that you won't be able to load ROS's joint trajectory controller directly in this simulator because it conflicts with the custom hardware interface defined for this project. So to support ROS joint trajectory action instead of the custom joint trajectory, you will either have to load default hardware instead of the custom hardware in the robot description file and test it, or use a simpler simulator that uses default hardware interfaces and controllers such as panda_simulation and test if the 'trajectory replacement' feature is what you want. Alternatively, you can directly test in on the real robot as it loads ROS joint trajectory action by default if you are using franka_ros or franka_ros_interface.

petrvancjr commented 3 years ago

When I tried to replace the trajectory, I observed an outage in trajectory tracing (row 3, row 4). The attached plot:

Screenshot from 2021-08-23 17-26-17

Even when I tried to remove the execution stop, I didn't observe any change. This is the reason that the controller in fact does not support the (the newer version) replacement operation and it stops execution entirely.

I will test it with the default hardware controller, thanks for your advice.