URDF的关节定义:
<joint name="my_joint" type="floating"> <origin xyz="0 0 1" rpy="0 0 3.1416"/> <parent link="link1"/> <child link="link2"/> <calibration rising="0.0"/> <dynamics damping="0.0" friction="0.0"/> <limit effort="30" velocity="1.0" lower="-2.2" upper="0.7" /> <safety_controller k_velocity="10" k_position="15" soft_lower_limit="-2.0" soft_upper_limit="0.5" /> </joint>
关节里面首先定了父link跟子link, 以及关节的转动轴.
接着是传感器的定义:
摄像头:
<sensor name="my_camera_sensor" update_rate="20"> <parent link="optical_frame_link_name"/> <origin xyz="0 0 0" rpy="0 0 0"/> <camera> <image width="640" height="480" hfov="1.5708" format="RGB8" near="0.01" far="50.0"/> </camera> </sensor>
激光传感器:
<sensor name="my_ray_sensor" update_rate="20"> <parent link="optical_frame_link_name"/> <origin xyz="0 0 0" rpy="0 0 0"/> <ray> <horizontal samples="100" resolution="1" min_angle="-1.5708" max_angle="1.5708"/> <vertical samples="1" resolution="1" min_angle="0" max_angle="0"/> </ray> </sensor>