ros-industrial / universal_robot

ROS-Industrial Universal Robots support (https://wiki.ros.org/universal_robot)
1.05k stars 1.03k forks source link

Velocity_controllers or effort_controllers for UR5 in simulation #608

Closed ghost closed 10 months ago

ghost commented 1 year ago

I know that UR5 is a joint-velocity-control robot that accepts velocity as an input. Still, I’m not sure what is the proper hardware interface (i.e. the low-level controller) I need to simulate in ROS. The ros_control package has an abundance of controller types. The most relevant ones for UR5 are velocity_controllers and effort_controllers.

effort_controllers/JointVelocityController velocity_controllers/JointVelocityController

The above controllers accept velocity as an input, but the actual command applied to the actuator differs. For example, in effort_controllers, velocity input is mapped into torque, whereas in the second one, velocity input is forwarded. Of course, we have more freedom in a simulation and can apply all controllers; however, if we want to be as close as possible to reality, which type should I use for the UR5? I’ve tried to read the documentation, but I only see controlling the platform via GUI. Any suggestions?

fmauch commented 1 year ago

The real robot can use joint position or joint velocity based input. In ROS multiple controllers exist based on the different hardware types. The gazebo simulation will not be exactly the same as the real robot. If you don't have any specific requirements for a specific hardware interface, then I would suggest sticking with the default.

Depending on your use case you might want to use a URSim-based simulation. With this you can use the normal driver as if connected to a real robot. The robot's dynamics aren't simulated exactly and you cannot add any simulated environments such as cameras as you could do in gazebo, but if you only need a robot motion simulation, that might be a valid approach.