当前位置:网站首页>Gazebo control example
Gazebo control example
2022-07-28 01:19:00 【2021 Nqq】
List of articles
Movement control implementation process
roslaunch urdf02_gazebo demo03_env.launch
start-up gazebo Simulation environment demo03_env.launch
launch file
<launch>
<!-- 1. It needs to be loaded in the parameter server urdf -->
<param name = "robot_description" command = "$(find xacro)/xacro $(find urdf02_gazebo)/urdf/car.urdf.xacro" />
<!-- 2. start-up Gazebo Simulation environment roslaunch gazebo_ros empty_world.launch-->
<include file = "$(find gazebo_ros)/launch/empty_world.launch">
<arg name = "world_name" value = "$(find urdf02_gazebo)/worlds/box_house.world" />
</include>
<!-- 3. stay Gazebo Add robot model in -->
<!-- rosrun gazebo_ros spawn_model -urdf -model mycar -param robot_description , here mycar yes robot name-->
<node pkg = "gazebo_ros" type = "spawn_model" name = "spawn_model" args = "-urdf -model mycar -param robot_description"/>
</launch>
Add drives and controllers move.xacro
<robot name="my_car_move" xmlns:xacro="http://wiki.ros.org/xacro">
<!-- Transmission realization : Used to connect the controller to the joint -->
<xacro:macro name="joint_trans" params="joint_name">
<!-- Transmission is important to link the joints and the controller -->
<transmission name="${joint_name}_trans">
<type>transmission_interface/SimpleTransmission</type>
<joint name="${joint_name}">
<hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>
</joint>
<actuator name="${joint_name}_motor">
<hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>
</xacro:macro>
<!-- Each driving wheel needs to be equipped with a transmission device -->
<xacro:joint_trans joint_name="left2link" />
<xacro:joint_trans joint_name="right2link" />
<!-- controller -->
<gazebo>
<plugin name="differential_drive_controller" filename="libgazebo_ros_diff_drive.so">
<rosDebugLevel>Debug</rosDebugLevel>
<publishWheelTF>true</publishWheelTF>
<robotNamespace>/</robotNamespace>
<publishTf>1</publishTf>
<publishWheelJointState>true</publishWheelJointState>
<alwaysOn>true</alwaysOn>
<updateRate>100.0</updateRate>
<legacyMode>true</legacyMode>
<leftJoint>left2ink</leftJoint> <!-- Left wheel -->
<rightJoint>right2link</rightJoint> <!-- Right wheel -->
<wheelSeparation>${base_radius * 2}</wheelSeparation> <!-- Wheel spacing -->
<wheelDiameter>${wheel_radius * 2}</wheelDiameter> <!-- Wheel diameter -->
<broadcastTF>1</broadcastTF>
<wheelTorque>30</wheelTorque>
<wheelAcceleration>1.8</wheelAcceleration>
<commandTopic>cmd_vel</commandTopic> <!-- Motion control topics -->
<odometryFrame>odom</odometryFrame> <!-- Coordinate system of odometer -->
<odometryTopic>odom</odometryTopic> <!-- Odometer topic -->
<robotBaseFrame>base_footprint</robotBaseFrame> <!-- Root coordinate system -->
</plugin>
</gazebo>
</robot>
add to xacro Integrated file car.urdf.xacro
<robot name="mycar" xmlns:xacro="http://wiki.ros.org/xacro">
<!-- Contains inertia matrix files -->
<xacro:include filename = "head.xacro" />
<!-- Including chassis 、 camera 、 Radar xacro file -->
<xacro:include filename = "demo02_car_base.urdf.xacro" />
<xacro:include filename = "demo03_car_camera.urdf.xacro" />
<xacro:include filename = "demo04_car_laser.urdf.xacro" />
<!-- Motion control -->
<xacro:include filename = "gazebo/move.xacro" />
</robot>
Rviz Check odometer messages
Odometer : The pose state of the robot relative to the starting point coordinate system (X coordinate Y coordinate Z Coordinates and orientation )
start-up Rviz demo04_sensor.launch
<launch>
<!-- start-up rviz -->
<node pkg = "rviz" type = "rviz" name = "rviz" args = "-d $(find urdf01_rviz)/config/show_mycar.rviz"/>
<!-- Add joint status publishing node -->
<node pkg = "joint_state_publisher" type = "joint_state_publisher" name = "joint_state_publisher" />
<!-- Add robot status publishing node -->
<node pkg = "robot_state_publisher" type = "robot_state_publisher" name = "robot_state_publisher" />
</launch>
source ./devel/setup.bash
roslaunch urdf02_gazebo demo03_env.launch
roslaunch urdf02_gazebo demo04_sensor.launch
Add the component
radar laser.xacro
<robot name="my_sensors" xmlns:xacro="http://wiki.ros.org/xacro">
<!-- radar -->
<gazebo reference="laser"><!-- reference The name should match demo04_car_laser The radar inside has the same name -->
<sensor type="ray" name="rplidar">
<pose>0 0 0 0 0 0</pose><!-- x y z Euler Angle -->
<visualize>true</visualize>
<update_rate>5.5</update_rate>
<ray>
<scan>
<horizontal>
<samples>360</samples> <!-- The radar rotates for one cycle to collect 360 A little bit -->
<resolution>1</resolution><!-- Each line will have a ranging ,2 It means that there will be one ranging for each two lines -->>
<min_angle>-3</min_angle><!-- The unit is radians turn right 3 A radian Clockwise -->
<max_angle>3</max_angle>
</horizontal>
</scan>
<range>
<min>0.10</min><!-- Radar sampling distance -->
<max>30.0</max>
<resolution>0.01</resolution><!-- accuracy -->
</range>
<noise>
<type>gaussian</type><!-- Gauss noise For simulation Simulation error -->
<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><!-- The name should match demo04_car_laser The radar inside has the same name -->
</plugin>
</sensor>
</gazebo>
</robot>
camera camera.xacro
<robot name="my_sensors" xmlns:xacro="http://wiki.ros.org/xacro">
<!-- Quoted link -->
<gazebo reference="camera">
<!-- The type is set to camara -->
<sensor type="camera" name="camera_node">
<update_rate>30.0</update_rate> <!-- The update frequency -->
<!-- Camera basic information settings -->
<camera name="head">
<horizontal_fov>1.3962634</horizontal_fov>
<image>
<width>1280</width>
<height>720</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>
<!-- Core plug-ins -->
<plugin name="gazebo_camera" filename="libgazebo_ros_camera.so">
<alwaysOn>true</alwaysOn>
<updateRate>0.0</updateRate>
<cameraName>/camera</cameraName>
<imageTopicName>image_raw</imageTopicName>
<cameraInfoTopicName>camera_info</cameraInfoTopicName>
<frameName>camera</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>
</robot>
rostopic pub -r 10 /cmd_vel Set parameters to make the robot rotate
边栏推荐
- swoole-WebSocket服务
- JS global function method module exports exports
- Gazebo 控制实例
- 范德蒙德卷积 学习笔记
- [game] Nintendo Nintendo switch ultra detailed purchase / use guide and precautions (continuous update according to your own use...)
- 逻辑回归原理
- 闻泰科技收购安世半导体剩余股权获得无条件通过
- Unknown database ‘xxxxx‘
- 国产NB-IoT芯片厂商芯翼信息科技获2亿元A+轮融资
- C语言main函数传递参数
猜你喜欢

Knowledge of two-dimensional array

Starfish Os打造的元宇宙生态,跟MetaBell的合作只是开始
![Thesis appreciation [iclr18] a neural language model combining syntax and vocabulary learning](/img/1c/5b9726b16f67dfc2016a0c2035baae.png)
Thesis appreciation [iclr18] a neural language model combining syntax and vocabulary learning

Iperf installation and use

Retinanet网络结构详解

Focus loss explanation

杂谈:一份最初就非常完善的FS跟第一版程序就要求没bug一样不切实际

ABAP CDS Table Function介绍与示例

Cross desktop web container evolution

Oxygen temperature and humidity module
随机推荐
Uni app advanced style framework / production environment
力挺吴雄昂!Arm中国管理层发公开信:对莫须有的指控感到震惊和愤怒!
BSP video tutorial issue 21: easy one key implementation of serial port DMA variable length transceiver, support bare metal and RTOS, including MDK and IAR, which is more convenient than stm32cubemx (
安全检测风险
Meguiar sued liandian for secret theft and sentenced: liandian was fined NT $100million and three employees were sentenced!
BigDecimal常用API
Starfish Os打造的元宇宙生态,跟MetaBell的合作只是开始
Insider of container network hard core technology (7) sailing on the sea depends on the helmsman
Oracle错误: ORA-01722 无效数字
The cooperation between starfish OS and metabell is just the beginning
C语言main函数传递参数
Lua进阶
Postman 的使用
System clock failure of database fault tolerance
如果某个表有近千万数据,CRUD比较慢,如何优化
The cooperation between starfish OS and metabell is just the beginning
Wu xiongang sent an internal letter: arm's allegations are unwarranted, and no damage is allowed to the existing achievements!
110. In depth introduction to sap ui5 fileuploader control - why do you need a hidden iframe
Deepening the concept of linear algebra [23] 01 - points coordinate points and vectors vectors
Matlab drawing - points and vectors: method and source code of vector addition and subtraction