目录:
- Ailibot2仿真入门教程-环境配置
- Ailibot2仿真入门教程-gazebo-设计简单的gazebo场景
- Ailibot2仿真入门教程-gazebo-使用gazebo插件生成场景的截面地图
- Ailibot2仿真入门教程-gazebo-加载gazebo场景
- Ailibot2仿真入门教程-加载Ailibot2的URDF模型到gazebo
- Ailibot2仿真入门教程-加载Ailibot2的SDF模型到gazebo
- Ailibot2仿真入门教程-利用robot_localization融合里程和IMU数据
- Ailibot2仿真入门教程-控制-键盘控制
- Ailibot2仿真入门教程-建图-gmapping建图
- Ailibot2仿真入门教程-建图-slam_toolbox建图
- Ailibot2仿真入门教程-建图-cartographer建图
文章说明
- 本教程主要介绍如何加载ailibot2的URDF模型到gazebo
- 测试环境:Ubuntu 20.04 + Gazebo11 + ROS2 Galactic
操作步骤
$ ros2 launch ailibot2_bringup robot_sim_with_ekf.launch.py
[INFO] [launch]: All log files can be found below /home/ubuntu/.ros/log/2023-09-07-18-36-21-627170-ailibotOS-VM-28302
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [gzserver-1]: process started with pid [28306]
[INFO] [gzclient -2]: process started with pid [28308]
[INFO] [spawn_entity.py-3]: process started with pid [28311]
[INFO] [robot_state_publisher-4]: process started with pid [28314]
[INFO] [ekf_node-5]: process started with pid [28316]
[robot_state_publisher-4] Link base_link had 6 children
[robot_state_publisher-4] Link caster_back_link had 0 children
[robot_state_publisher-4] Link caster_front_link had 0 children
[robot_state_publisher-4] Link imu_link had 0 children
[robot_state_publisher-4] Link laser_link had 0 children
[robot_state_publisher-4] Link wheel_left_link had 0 children
[robot_state_publisher-4] Link wheel_right_link had 0 children
[robot_state_publisher-4] [INFO] [1694082982.529842060] [robot_state_publisher]: got segment base_footprint
[robot_state_publisher-4] [INFO] [1694082982.529904860] [robot_state_publisher]: got segment base_link
[robot_state_publisher-4] [INFO] [1694082982.529913754] [robot_state_publisher]: got segment caster_back_link
[robot_state_publisher-4] [INFO] [1694082982.529919142] [robot_state_publisher]: got segment caster_front_link
[robot_state_publisher-4] [INFO] [1694082982.529923927] [robot_state_publisher]: got segment imu_link
[robot_state_publisher-4] [INFO] [1694082982.529928443] [robot_state_publisher]: got segment laser_link
[robot_state_publisher-4] [INFO] [1694082982.529932945] [robot_state_publisher]: got segment wheel_left_link
[robot_state_publisher-4] [INFO] [1694082982.529937518] [robot_state_publisher]: got segment wheel_right_link
[spawn_entity.py-3] [INFO] [1694082982.860998491] [spawn_entity]: Spawn Entity started
[spawn_entity.py-3] [INFO] [1694082982.861365252] [spawn_entity]: Loading entity published on topic robot_description
[spawn_entity.py-3] [INFO] [1694082982.863082087] [spawn_entity]: Waiting for entity xml on robot_description
[spawn_entity.py-3] [INFO] [1694082982.865577551] [spawn_entity]: Waiting for service /spawn_entity, timeout = 5
[spawn_entity.py-3] [INFO] [1694082982.865911081] [spawn_entity]: Waiting for service /spawn_entity
[spawn_entity.py-3] [INFO] [1694082983.620555067] [spawn_entity]: Calling service /spawn_entity
[spawn_entity.py-3] [INFO] [1694082983.683293283] [spawn_entity]: Spawn status: Entity pushed to spawn queue, but spawn service timed outwaiting for entity to appear in simulation under the name [ailibot2]
[spawn_entity.py-3] [ERROR] [1694082983.683632180] [spawn_entity]: Spawn service failed. Exiting.
[spawn_entity.py-3] /opt/ros/galactic/lib/python3.8/site-packages/rclpy/qos.py:307: UserWarning: DurabilityPolicy.RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL is deprecated. Use DurabilityPolicy.TRANSIENT_LOCAL instead.
[spawn_entity.py-3] warnings.warn(
[gzserver-1] [INFO] [1694082984.073103611] [ailibot_d2_controller]: Wheel pair 1 separation set to [0.325140m]
[gzserver-1] [INFO] [1694082984.073816952] [ailibot_d2_controller]: Wheel pair 1 diameter set to [0.115000m]
[gzserver-1] [INFO] [1694082984.075420133] [ailibot_d2_controller]: Subscribed to [/cmd_vel]
[gzserver-1] [INFO] [1694082984.078038886] [ailibot_d2_controller]: Advertise odometry on [/wheel/odometry]
[gzserver-1] [INFO] [1694082984.091534683] [bytes_joint_state]: Going to publish joint [wheel_left_joint]
[gzserver-1] [INFO] [1694082984.091591341] [bytes_joint_state]: Going to publish joint [wheel_right_joint]
[gzclient -2] context mismatch in svga_surface_destroy
[gzclient -2] context mismatch in svga_surface_destroy
- 查看话题
$ ros2 topic list
/clock
/cmd_vel
/diagnostics
/imu/data
/joint_states
/odom
/parameter_events
/performance_metrics
/robot_description
/rosout
/scan
/set_pose
/tf
/tf_static
/wheel/odometry
- 模型直接发布的里程话题为/wheel/odometry
- 通过robot_localization融合/wheel/odometry和imu的/scan数据后,获取新的里程数据/odom