Gazeboのチュートリアル第六弾「Connect to ROS」。
ROSはロボットの制御フレームワークです。このチュートリアルでは、GazeboとROSのインターフェースについて説明します。
今回はその「Gazebo Plugins in ROS」編です。
公式サイトを適当に翻訳しただけですので、あしからず。
<gazeboreference="camera_link"><sensortype="camera"name="camera1"><update_rate>30.0</update_rate><cameraname="head"><horizontal_fov>1.3962634</horizontal_fov><image><width>800</width><height>800</height><format>R8G8B8</format></image><clip><near>0.02</near><far>300</far></clip><noise><type>gaussian</type><!-- Noise is sampled independently per pixel on each frame. That pixel's noise value is added to each of its color channels, which at that point lie in the range [0,1]. --><mean>0.0</mean><stddev>0.007</stddev></noise></camera><pluginname="camera_controller"filename="libgazebo_ros_camera.so"><alwaysOn>true</alwaysOn><updateRate>0.0</updateRate><cameraName>rrbot/camera1</cameraName><imageTopicName>image_raw</imageTopicName><cameraInfoTopicName>camera_info</cameraInfoTopicName><frameName>camera_link</frameName><hackBaseline>0.07</hackBaseline><distortionK1>0.0</distortionK1><distortionK2>0.0</distortionK2><distortionK3>0.0</distortionK3><distortionT1>0.0</distortionT1><distortionT2>0.0</distortionT2></plugin></sensor></gazebo>
In this code example there is both a left and right camera:
<gazeboreference="left_camera_frame"><sensortype="multicamera"name="stereo_camera"><update_rate>30.0</update_rate><cameraname="left"><horizontal_fov>1.3962634</horizontal_fov><image><width>800</width><height>800</height><format>R8G8B8</format></image><clip><near>0.02</near><far>300</far></clip><noise><type>gaussian</type><mean>0.0</mean><stddev>0.007</stddev></noise></camera><cameraname="right"><pose>0 -0.07 0 0 0 0</pose><horizontal_fov>1.3962634</horizontal_fov><image><width>800</width><height>800</height><format>R8G8B8</format></image><clip><near>0.02</near><far>300</far></clip><noise><type>gaussian</type><mean>0.0</mean><stddev>0.007</stddev></noise></camera><pluginname="stereo_camera_controller"filename="libgazebo_ros_multicamera.so"><alwaysOn>true</alwaysOn><updateRate>0.0</updateRate><cameraName>multisense_sl/camera</cameraName><imageTopicName>image_raw</imageTopicName><cameraInfoTopicName>camera_info</cameraInfoTopicName><frameName>left_camera_optical_frame</frameName><!--<rightFrameName>right_camera_optical_frame</rightFrameName>--><hackBaseline>0.07</hackBaseline><distortionK1>0.0</distortionK1><distortionK2>0.0</distortionK2><distortionK3>0.0</distortionK3><distortionT1>0.0</distortionT1><distortionT2>0.0</distortionT2></plugin></sensor></gazebo>
<!-- hokuyo --><gazeboreference="hokuyo_link"><sensortype="gpu_ray"name="head_hokuyo_sensor"><pose>0 0 0 0 0 0</pose><visualize>false</visualize><update_rate>40</update_rate><ray><scan><horizontal><samples>720</samples><resolution>1</resolution><min_angle>-1.570796</min_angle><max_angle>1.570796</max_angle></horizontal></scan><range><min>0.10</min><max>30.0</max><resolution>0.01</resolution></range><noise><type>gaussian</type><!-- Noise parameters based on published spec for Hokuyo laser achieving "+-30mm" accuracy at range < 10m. A mean of 0.0m and stddev of 0.01m will put 99.7% of samples within 0.03m of the true reading. --><mean>0.0</mean><stddev>0.01</stddev></noise></ray><pluginname="gazebo_ros_head_hokuyo_controller"filename="libgazebo_ros_gpu_laser.so"><topicName>/rrbot/laser/scan</topicName><frameName>hokuyo_link</frameName></plugin></sensor></gazebo>
説明 : シミュレーションの中でgeometry_msgsで記述されているWrenchStampdメッセージ上書きして、ボディへの外力を配信します。Ground Truthとは…
Description: broadcasts external forces on a body in simulation over WrenchStamped message as described in geometry_msgs.
<robotname="test_model"><!-- root link, on the ground just below the model origin --><linkname="base_footprint"><visual><originxyz="0 0 0"rpy="0 0 0"/><geometry><boxsize="0.001 0.001 0.001"/></geometry></visual></link><jointname="base_link_joint"type="fixed"><originxyz="0.0 0 1.25"rpy="0 0 0"/><parentlink="base_footprint"/><childlink="base_link"/></joint><!-- the model --><linkname="base_link"><inertial><massvalue="50"/><originxyz="0 0 -1.25"/><inertiaixx="50.0"ixy="0.0"ixz="0.0"iyy="50.0"iyz="0.0"izz="50.0"/></inertial><visual><geometry><boxsize="0.5 0.5 1.0"/><!-- does not need to match collision --></geometry></visual><collision><originxyz="0 0 -1.0"/><geometry><cylinderlength="0.5"radius="0.25"/></geometry></collision></link><gazebo><pluginname="object_controller"filename="libgazebo_ros_planar_move.so"><commandTopic>cmd_vel</commandTopic><odometryTopic>odom</odometryTopic><odometryFrame>odom</odometryFrame><odometryRate>20.0</odometryRate><robotBaseFrame>base_footprint</robotBaseFrame></plugin></gazebo></robot>