赞
踩
ROS教程 Gazebo仿真(1)–ros_control两轮差速控制
https://blog.csdn.net/weixin_43928944/article/details/115899503
laser_sensors.xacro
<robot name="my_sensors" xmlns:xacro="http://wiki.ros.org/xacro"> <!-- 雷达 --> <gazebo reference="laser"> <sensor type="ray" name="rplidar"> <pose>0 0 0 0 0 0</pose> <visualize>true</visualize> <update_rate>5.5</update_rate> <ray> <scan> <horizontal> <samples>360</samples> <resolution>1</resolution> <min_angle>-3</min_angle> <max_angle>3</max_angle> </horizontal> </scan> <range> <min>0.10</min> <max>30.0</max> <resolution>0.01</resolution> </range> <noise> <type>gaussian</type> <mean>0.0</mean> <stddev>0.01</stddev> </noise> </ray> <plugin name="gazebo_rplidar" filename="libgazebo_ros_laser.so"> <topicName>/scan</topicName> <frameName>laser</frameName> </plugin> </sensor> </gazebo> </robot>
robt_car.xacro
<robot name="robot_car" xmlns:xacro="http://wiki.ros.org/xacro">
<xacro:include filename="inertia.xacro" />
<xacro:include filename="robot_base.xacro" />
<xacro:include filename="camera.xacro" />
<xacro:include filename="laser.xacro" />
<xacro:include filename="gazebo/move.xacro" />
<xacro:include filename="gazebo/laser_sensors.xacro" />
</robot>
rviz launch
unch>
<param name="robot_description" command="$(find xacro)/xacro $(find robot_description)/urdf/robot_car.xacro" />
<node pkg="rviz" type="rviz" name="rviz" args="-d $(find robot_description)/config/car.rviz" />
<node pkg="joint_state_publisher" type="joint_state_publisher" name="joint_state_publisher" output="screen" />
<node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output="screen" />
<node pkg="joint_state_publisher_gui" type="joint_state_publisher_gui" name="joint_state_publisher_gui" output="screen" />
</launch>
启动rviz的launch Add添加LaserScan 将Topic修改为/scan 配置完成。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。