problems with a simple realtime joint controller in Gazebo
Hello,
I'm trying to follow along with the Writing a realtime joint controller tutorial. I've got the class all set up, and I believe I've got it installed correctly using the plugin lib, as I can see the controller when I do
rosrun pr2_controller_manager pr2_controller_manager list
and I can see that the plugin is running OK. The problem is that even when I set the joint_state_->commanded_effort_ to a fixed value, I don't see any change in the joints of my simulation in gazebo. However, when I do a rostopic echo of the /mechanism_statistics, I can see that the commanded effort is non-zero and that the limits haven't been violated:
name: p_one_joint_4
timestamp:
secs: 54
nsecs: 5000000
position: 0.0
velocity: 0.0
measured_effort: 0.0
commanded_effort: -100.0
is_calibrated: True
violated_limits: False
odometer: 0.0
min_position: 0.0
max_position: 0.0
max_abs_velocity: 0.0
max_abs_effort: 0.0
Also, it is interesting that when I go into gazebo and tinker with the joints manually by using the little hand tool and making the joints move, I don't see anything when I add a printf into the controller to print the joint position (it stays 0). I know that putting a printf in the controller is a bad idea for real-time behavior... Any hints on why I can't get the joint to move with my simple controller would be appreciated. Also in my joint definition in my URDF file I do not have a limit or safety_controller tag currently in it (they're below but commented out):
<joint name="${parent}_${suffix}_joint_4" type="continuous">
<origin xyz="${link_4_len} 0 0" rpy="0 0 0" />
<axis xyz="0 1 0" />
<!-- <limit effort="10" velocity="10" /> -->
<!-- <safety_controller soft_lower_limit="-1.5" soft_upper_limit="1.5" k_position="1" k_velocity="1"/> -\-> -->
<joint_properties damping="0.0" friction="0.0" />
<parent link="${parent}_${suffix}_link_4" />
<child link="${parent}_${suffix}_link_5" />
</joint>
I have also verified that the links look OK in the simulation as well as in rviz, and the TF tree looks like it's being published.
Is this joint connected to any actuators?