I can't seem to find any examples with imported URDFs (the universal robot examples don't seem to have any physics settings beyond joint inertias etc).
My robot has mass from the urdf:
But it seems to just float:
If I manually add physics in webots (by right clicking on physics and adding a physics node) it falls as expected but the wheels fall off (despite still moving around with the controllers).
While amusing, this isn't exactly what I'd like it to do. Is there a physics tag or something I might be missing in the urdf?
These are the only webots sections I have in the urdf at the moment because it's all I could find reference to in the examples.
<webots>
<plugin type="webots_ros2_control::Ros2Control"/>
</webots>
<ros2_control name="WebotsControl" type="system">
<hardware>
<plugin>webots_ros2_control::Ros2ControlSystem</plugin>
</hardware>
<joint name="left_wheel_joint">
<command_interface name="velocity">
</command_interface>
<state_interface name="position"/>
</joint>
<joint name="right_wheel_joint">
<state_interface name="position"/>
<command_interface name="velocity"/>
</joint>
</ros2_control>
Edit: This is the full urdf (I'll be generating it from a xacro eventually but I'm using just a single exported urdf at the moment to get the basics working before I complicated things). It's based on Josh's ROS 2 tutorials on his Articulated Robotics channel.
<?xml version="1.0" ?>
<!-- =================================================================================== -->
<!-- | This document was autogenerated by xacro from robot.urdf.xacro | -->
<!-- | EDITING THIS FILE BY HAND IS NOT RECOMMENDED | -->
<!-- =================================================================================== -->
<robot name="articubot_one">
<!-- BASE LINK -->
<link name="base_link" />
<!-- BASE_FOOTPRINT LINK -->
<joint name="base_footprint_joint" type="fixed">
<parent link="base_link"/>
<child link="base_footprint"/>
<origin rpy="0 0 0" xyz="0 0 0"/>
</joint>
<link name="base_footprint">
</link>
<!-- CHASSIS LINK -->
<joint name="chassis_joint" type="fixed">
<parent link="base_link"/>
<child link="chassis"/>
<origin xyz="-0.226 0 -0.01"/>
</joint>
<link name="chassis">
<visual>
<origin xyz="0.1675 0 0.069"/>
<geometry>
<box size="0.335 0.265 0.138"/>
</geometry>
<material name="orange"/>
</visual>
<collision>
<origin xyz="0.1675 0 0.069"/>
<geometry>
<box size="0.335 0.265 0.138"/>
</geometry>
</collision>
<inertial>
<origin rpy="0 0 0" xyz="0.1675 0 0.069"/>
<mass value="0.5"/>
<inertia ixx="0.003719541666666667" ixy="0.0" ixz="0.0" iyy="0.005469541666666668" iyz="0.0" izz="0.007602083333333334"/>
</inertial>
</link>
<!-- LEFT WHEEL LINK -->
<joint name="left_wheel_joint" type="continuous">
<parent link="base_link"/>
<child link="left_wheel"/>
<origin rpy="-1.5707963267948966 0 0" xyz="0 0.1485 0"/>
<axis xyz="0 0 1"/>
</joint>
<link name="left_wheel">
<visual>
<geometry>
<cylinder length="0.026" radius="0.033"/>
</geometry>
<material name="blue"/>
</visual>
<collision>
<geometry>
<sphere radius="0.033"/>
</geometry>
</collision>
<inertial>
<origin rpy="0 0 0" xyz="0 0 0"/>
<mass value="0.05"/>
<inertia ixx="1.642916666666667e-05" ixy="0.0" ixz="0.0" iyy="1.642916666666667e-05" iyz="0.0" izz="2.7225000000000004e-05"/>
</inertial>
</link>
<!-- RIGHT WHEEL LINK -->
<joint name="right_wheel_joint" type="continuous">
<parent link="base_link"/>
<child link="right_wheel"/>
<origin rpy="1.5707963267948966 0 0" xyz="0 -0.1485 0"/>
<axis xyz="0 0 -1"/>
</joint>
<link name="right_wheel">
<visual>
<geometry>
<cylinder length="0.026" radius="0.033"/>
</geometry>
<material name="blue"/>
</visual>
<collision>
<geometry>
<sphere radius="0.033"/>
</geometry>
</collision>
<inertial>
<origin rpy="0 0 0" xyz="0 0 0"/>
<mass value="0.05"/>
<inertia ixx="1.642916666666667e-05" ixy="0.0" ixz="0.0" iyy="1.642916666666667e-05" iyz="0.0" izz="2.7225000000000004e-05"/>
</inertial>
</link>
<!-- CASTER WHEEL LINK -->
<joint name="caster_wheel_joint" type="fixed">
<parent link="chassis"/>
<child link="caster_wheel"/>
<origin xyz="0.075 0 -0.013"/>
</joint>
<link name="caster_wheel">
<visual>
<geometry>
<sphere radius="0.01"/>
</geometry>
<material name="white"/>
</visual>
<collision>
<geometry>
<sphere radius="0.01"/>
</geometry>
</collision>
<inertial>
<origin rpy="0 0 0" xyz="0 0 0"/>
<mass value="0.01"/>
<inertia ixx="4.0000000000000003e-07" ixy="0.0" ixz="0.0" iyy="4.0000000000000003e-07" iyz="0.0" izz="4.0000000000000003e-07"/>
</inertial>
</link>
<webots>
<plugin type="webots_ros2_control::Ros2Control"/>
</webots>
<ros2_control name="WebotsControl" type="system">
<hardware>
<plugin>webots_ros2_control::Ros2ControlSystem</plugin>
</hardware>
<joint name="left_wheel_joint">
<command_interface name="velocity">
</command_interface>
<state_interface name="position"/>
</joint>
<joint name="right_wheel_joint">
<state_interface name="position"/>
<command_interface name="velocity"/>
</joint>
</ros2_control>
</robot>
Any thoughts would be appreciated.
Thanks