how to read odomety and imu sensor in gazebo
I am newbie in ROS and gazebo. I have a differential robot model and I add odometry and imu plugin. but once i subscribe the topic, here is the condition 1st Condition : (in visual, the robot turn to 90 degree) - odometry result : 45 degree - imu result : 90,... degree
2nd Condition, once i terminate and start again : (in visual, the robot turn to 90 degree) - odometry result : 45 degree - imu result : 0.000025,... degree
what should i do? here is my .gazebo files <?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">
<!-- ros_control plugin -->
<gazebo>
<plugin name="gazebo_ros_control"
filename="libgazebo_ros_control.so">
<robotNamespace>/my_robot</robotNamespace>
<robotParam>/robot_description</robotParam>
<robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType>
</plugin>
</gazebo>
<!--
The plugin broadcasts a body's pose and rates through ROS nav_msgs::Odometry message.
The plugin broadcasts pose and rate of a body named "chassis" over ROS topic name "my_robot/odom".
-->
<gazebo>
<plugin name="ground_truth"
filename="libgazebo_ros_p3d.so">
<frameName>map</frameName>
<bodyName>chassis</bodyName>
<!-- <topicName>my_robot/odom</topicName> -->
<topicName>odom</topicName>
<updateRate>30.0</updateRate>
</plugin>
</gazebo>
<!-- Chassis -->
<gazebo reference="chassis">
<mu1>0.3</mu1>
<mu2>0.3</mu2>
<material>Gazebo/black</material>
</gazebo>
<!-- Caster wheel -->
<gazebo reference="caster_wheel">
<mu1>0.0</mu1>
<mu2>0.0</mu2>
<kp>1000000.0</kp>
<kd>100.0</kd>
<minDepth>0.001</minDepth>
<maxVel>1.0</maxVel>
<material>Gazebo/Chrome</material>
</gazebo>
<!-- <gazebo>
<sensor name="imu_sensor" type="imu">
<always_on>1</always_on>
<update_rate>1000</update_rate>
<visualize>1</visualize>
<topic>__default_topic__</topic>
<controller:gazebo_ros_imu name="imu_controller" plugin="libgazebo_ros_imu.so">
<alwaysOn>true</alwaysOn>
<updateRate>20.0</updateRate>
<bodyName>imu_link</bodyName>
<topicName>imu_data</topicName>
<gaussianNoise>2.89e-08</gaussianNoise>
<xyzOffsets>0 0 0</xyzOffsets>
<rpyOffsets>0 0 0</rpyOffsets>
<interface:position name="imu_position"/>
</controller:gazebo_ros_imu>
</gazebo> -->
<!-- <gazebo reference="imu_sensor_link">
<gravity>true</gravity>
<imu>
<angular_velocity>
<x>
<noise type="gaussian">
<mean>0.0</mean>
<stddev>2e-4</stddev>
<bias_mean>0.0000075</bias_mean>
<bias_stddev>0.0000008</bias_stddev>
</noise>
</x>
<y>
<noise type="gaussian">
<mean>0.0</mean>
<stddev>2e-4</stddev>
<bias_mean>0.0000075</bias_mean>
<bias_stddev>0.0000008</bias_stddev>
</noise>
</y>
<z>
<noise type="gaussian">
<mean>0.0</mean>
<stddev>2e-4</stddev>
<bias_mean>0.0000075</bias_mean>
<bias_stddev>0.0000008</bias_stddev>
</noise>
</z>
</angular_velocity>
<linear_acceleration>
<x>
<noise type="gaussian">
<mean>0.0</mean>
<stddev>1.7e-2</stddev>
<bias_mean>0.1</bias_mean>
<bias_stddev>0.001</bias_stddev>
</noise>
</x>
<y>
<noise type="gaussian">
<mean>0.0</mean>
<stddev>1.7e-2</stddev>
<bias_mean>0.1</bias_mean>
<bias_stddev>0.001</bias_stddev>
</noise>
</y>
<z>
<noise type="gaussian">
<mean>0.0</mean>
<stddev>1.7e-2</stddev>
<bias_mean>0.1</bias_mean>
<bias_stddev>0.001</bias_stddev>
</noise>
</z>
</linear_acceleration>
</imu>
<sensor name="imu_sensor" type="imu">
<always_on>1</always_on>
<update_rate>1000</update_rate>
<visualize>1</visualize>
<topic>__default_topic__</topic>
<plugin filename="libgazebo_ros_imu_sensor.so" name="imu_plugin">
<topicName>imu_data</topicName>
<bodyName>imu_sensor_link</bodyName>
<updateRateHZ>100.0</updateRateHZ>
<gaussianNoise>2.89e-08</gaussianNoise>
<xyzOffsets>0 0 0</xyzOffsets>
<rpyOffsets>0 0 0</rpyOffsets>
</plugin>
<pose>0 0 0 0 0 0</pose>
</sensor>
</gazebo> -->
<gazebo>
<plugin name="differential_drive_controller"
filename="libgazebo_ros_diff_drive.so">
<!-- <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so"> -->
<!-- <robotNamespace>/</robotNamespace> -->
<alwaysOn>true</alwaysOn>
<updateRate>20</updateRate>
<leftJoint>left_wheel_hinge</leftJoint>
<rightJoint>right_wheel_hinge</rightJoint>
<wheelSeparation>0.21</wheelSeparation>
<wheelDiameter>0.06</wheelDiameter>
<torque>20</torque>
<!-- <commandTopic>my_robot/cmd_vel</commandTopic>
<odometryTopic>my_robot/odom</odometryTopic> -->
<commandTopic>cmd_vel</commandTopic>
<odometryFrame>odom</odometryFrame>
<robotBaseFrame>base_footprint</robotBaseFrame>
<legacyMode>false</legacyMode>
<rosDebugLevel>Debug</rosDebugLevel>
<publishWheelTF>true</publishWheelTF>
<publishWheelJointState>true</publishWheelJointState>
<wheelAcceleration>5</wheelAcceleration>
<wheelTorque>20</wheelTorque>
<publishTf>1</publishTf>
<odometrySource>encoder</odometrySource>
</plugin>
<plugin filename="libgazebo_ros_imu.so" name="imu_plugin">
<bodyName>base_footprint</bodyName>
<updateRate>20.0</updateRate>
<topicName>imu_data</topicName>
<serviceName>imu_service</serviceName>
<gaussianNoise>2.89e-08</gaussianNoise>
<xyzOffsets>0 0 0</xyzOffsets>
<rpyOffsets>0 0 0</rpyOffsets>
</plugin>
</gazebo>
</robot>
Asked by JossiChrist on 2018-04-02 08:44:44 UTC
Comments