Unable to connect Gazebo to ROS_Control
I'm trying to follow the Gazebo ROS Control tutorial but when I run the line:
roslaunch myrobot_gazebo myrobot_world.launch
I get the error output:
[ INFO] [1430582458.651473605]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1430582458.655485962]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
spawn_model script started
[INFO] [WallTime: 1430582458.938102] [0.000000] Loading model xml from ros parameter
[INFO] [WallTime: 1430582458.941118] [0.000000] Waiting for service /gazebo/spawn_urdf_model
[ INFO] [1430582459.741922815, 0.023000000]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1430582459.819138448, 0.096000000]: Physics dynamic reconfigure ready.
[INFO] [WallTime: 1430582459.855947] [0.132000] Calling service /gazebo/spawn_urdf_model
[INFO] [WallTime: 1430582460.083841] [0.295000] Spawn status: SpawnModel: Successfully spawned model
[ INFO] [1430582460.118077443, 0.295000000]: Loading gazebo_ros_control plugin
[ INFO] [1430582460.118570188, 0.295000000]: Starting gazebo_ros_control plugin in namespace: /myrobot
[ INFO] [1430582460.120080182, 0.295000000]: gazebo_ros_control plugin is waiting for model URDF in parameter [/robot_description] on the ROS param server.
[ERROR] [1430582460.223045545, 0.295000000]: No valid hardware interface element found in joint 'torso_to_front_right_leg_joint'.
[ERROR] [1430582460.223576289, 0.295000000]: Failed to load joints for transmission 'torso_to_front_right_leg_joint_trans'.
[ INFO] [1430582460.363040693, 0.295000000]: Loaded gazebo_ros_control.
[urdf_spawner-3] process has finished cleanly
log file: /home/chris/.ros/log/6b610a90-f0e4-11e4-bb58-001c1091e5ab/urdf_spawner-3*.log
[ERROR] [1430582476.852961975, 16.562000000]: Exception thrown while initializing controller torso_to_front_right_leg_joint_position_controller.
Could not find resource 'torso_to_front_right_leg_joint' in 'hardware_interface::EffortJointInterface'.
[ERROR] [1430582476.853310724, 16.563000000]: Initializing controller 'torso_to_front_right_leg_joint_position_controller' failed
My robot's urdf is just a single box "torso" with a single box "leg", and all the joints and interfaces and transmissions are defined:
<?xml version="1.0"?>
<robot name="myrobot"
xmlns:xacro="http://www.ros.org/wiki/xacro">
<xacro:macro name="box_inertia" params="mass x y z">
<inertia
ixx="${mass*(y*y+z*z)/12}" ixy="0" ixz="0"
iyy="${mass*(x*x+z*z)/12}" iyz="0" izz="${mass*(x*x+z*z)/12}" />
</xacro:macro>
<xacro:include filename="$(find myrobot_description)/urdf/materials.urdf.xacro" />
<!-- width in meters -->
<property name="torso_x_size" value="0.1" />
<!-- length in meters -->
<property name="torso_y_size" value="0.205" />
<!-- height in meters -->
<property name="torso_z_size" value="0.03" />
<!-- torso mass (not including legs) in kg -->
<property name="torso_mass" value="0.920" />
<!-- distance from ground to shoulders when standing at full height -->
<property name="total_leg_height" value="0.158" />
<!-- mass of a single upper leg piece in kg -->
<property name="upper_leg_mass" value="0.010" />
<property name="upper_leg_depth" value="0.003" />
<property name="upper_leg_length" value="0.04" />
<property name="upper_leg_thickness" value="0.005" />
<link name="base_footprint">
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<box size="0.001 0.001 0.001" />
</geometry>
</visual>
<inertial>
<mass value="0.0001" />
<origin xyz="0 0 0" />
<inertia
ixx="0.0001" ixy="0.0" ixz="0.0"
iyy="0.0001" iyz="0.0" izz="0.0001" />
</inertial>
</link>
<gazebo reference="base_footprint">
<turnGravityOff>false</turnGravityOff>
</gazebo>
<joint name="base_footprint_joint" type="fixed">
<origin xyz="0 0 ${total_leg_height}" rpy="0 0 0" />
<parent link="base_footprint"/>
<child link="base_link" />
</joint>
<link name="base_link">
<visual>
<geometry>
<box size="${torso_x_size} ${torso_y_size} ${torso_z_size}" />
</geometry ...