This question would better be asked on ROS answers, as I think, there aren’t too many ROS users in this particular community.
I’ll try to answer your question to the best of my knowledge, anyway…
The trajectory controllers define a trajectory by a set of setpoints consisting of joint positions, velocities, accelerations, jerks and a time. Let’s leave out acceleration and jerks for a moment, as they aren’t used by most controllers, anyway.
If we look at it in one dimension (one joint), a trajectory could look like the graph below. We have a trajectory containing of 4 waypoints:
- At time 0 we want to be at
theta=1
with a (known, but not readable from the graph) velocity > 0
- At time 1 we want to be at
theta=2
with velocity 0
- At time 2 we want to be at
theta=1
with a (known, but not readable from the graph) velocity < 0
- At time 7 we want to be at
theta=0
with velocity 0
The trajectory controller generates a spline connecting all of those waypoints. It is important to note that the velocities specified inside the trajectory specify the velocity in that waypoint, meaning the slope of the graph in that particular waypoint. (the acceleration being the curvature, and so on).
So, in this particular trajectory the joint will never have a constant velocity of that particular joint, as that’s the nature of how the spline interpolation of trajectories work.
So, if you’d like to have a joint moving at a specified, constant velocity, the velocity_controllers/JointGroupVelocityController
would indeed be your friend. However, I think this is not defined inside the gazebo simulation controller specification, so you’d have to define it yourself.
As you are probably unloading the running controller and try to spawn an undefined controller, the gazebo model doesn’t have any active controller anymore and thus falls apart.
You could probably specify a velocity_controllers/JointGroupVelocityController
inside your simulation’s controllers config similar to the joint_group_vel_controller
inside the ur_robot_driver
’s controllers.yaml
file