Ailibot2仿真入门教程-加载Ailibot2的URDF模型到gazebo
文章说明
- 本教程主要介绍如何加载ailibot2的URDF模型到gazebo
- 测试环境:Ubuntu 20.04 + Gazebo11
操作步骤
- 启动gazebo仿真,加载Ailibot2的urdf模型
$ ros2 launch ailibot2_bringup robot_sim.launch.py use_rviz:=true
[INFO] [launch]: All log files can be found below /home/ubuntu/.ros/log/2023-09-07-18-08-51-720475-ailibotOS-VM-26766
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [gzserver-1]: process started with pid [26769]
[INFO] [gzclient -2]: process started with pid [26772]
[INFO] [spawn_entity.py-3]: process started with pid [26774]
[INFO] [robot_state_publisher-4]: process started with pid [26777]
[robot_state_publisher-4] Link base_link had 8 children
[robot_state_publisher-4] Link camera_bottom_screw_frame had 1 children
[robot_state_publisher-4] Link camera_link had 1 children
[robot_state_publisher-4] Link camera_depth_frame had 4 children
[robot_state_publisher-4] Link camera_color_frame had 1 children
[robot_state_publisher-4] Link camera_color_optical_frame had 0 children
[robot_state_publisher-4] Link camera_depth_optical_frame had 0 children
[robot_state_publisher-4] Link camera_left_ir_frame had 1 children
[robot_state_publisher-4] Link camera_left_ir_optical_frame had 0 children
[robot_state_publisher-4] Link camera_right_ir_frame had 1 children
[robot_state_publisher-4] Link camera_right_ir_optical_frame had 0 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 sonar_front_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] [1694081332.651374226] [robot_state_publisher]: got segment base_footprint
[robot_state_publisher-4] [INFO] [1694081332.651822593] [robot_state_publisher]: got segment base_link
[robot_state_publisher-4] [INFO] [1694081332.652175479] [robot_state_publisher]: got segment camera_bottom_screw_frame
[robot_state_publisher-4] [INFO] [1694081332.652513127] [robot_state_publisher]: got segment camera_color_frame
[robot_state_publisher-4] [INFO] [1694081332.652525611] [robot_state_publisher]: got segment camera_color_optical_frame
[robot_state_publisher-4] [INFO] [1694081332.652531300] [robot_state_publisher]: got segment camera_depth_frame
[robot_state_publisher-4] [INFO] [1694081332.652536279] [robot_state_publisher]: got segment camera_depth_optical_frame
[robot_state_publisher-4] [INFO] [1694081332.652541354] [robot_state_publisher]: got segment camera_left_ir_frame
[robot_state_publisher-4] [INFO] [1694081332.652546264] [robot_state_publisher]: got segment camera_left_ir_optical_frame
[robot_state_publisher-4] [INFO] [1694081332.652551285] [robot_state_publisher]: got segment camera_link
[robot_state_publisher-4] [INFO] [1694081332.652556349] [robot_state_publisher]: got segment camera_right_ir_frame
[robot_state_publisher-4] [INFO] [1694081332.652561148] [robot_state_publisher]: got segment camera_right_ir_optical_frame
[robot_state_publisher-4] [INFO] [1694081332.652565856] [robot_state_publisher]: got segment caster_back_link
[robot_state_publisher-4] [INFO] [1694081332.652570584] [robot_state_publisher]: got segment caster_front_link
[robot_state_publisher-4] [INFO] [1694081332.652575705] [robot_state_publisher]: got segment imu_link
[robot_state_publisher-4] [INFO] [1694081332.652580548] [robot_state_publisher]: got segment laser_link
[robot_state_publisher-4] [INFO] [1694081332.652585332] [robot_state_publisher]: got segment sonar_front_link
[robot_state_publisher-4] [INFO] [1694081332.652590051] [robot_state_publisher]: got segment wheel_left_link
[robot_state_publisher-4] [INFO] [1694081332.652594854] [robot_state_publisher]: got segment wheel_right_link
[spawn_entity.py-3] [INFO] [1694081332.986670358] [spawn_entity]: Spawn Entity started
[spawn_entity.py-3] [INFO] [1694081332.987017877] [spawn_entity]: Loading entity published on topic robot_description
[spawn_entity.py-3] [INFO] [1694081332.988619300] [spawn_entity]: Waiting for entity xml on robot_description
[spawn_entity.py-3] [INFO] [1694081332.991390178] [spawn_entity]: Waiting for service /spawn_entity, timeout = 5
[spawn_entity.py-3] [INFO] [1694081332.991757938] [spawn_entity]: Waiting for service /spawn_entity
[spawn_entity.py-3] [INFO] [1694081333.746737075] [spawn_entity]: Calling service /spawn_entity
[spawn_entity.py-3] [INFO] [1694081333.809630889] [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] [1694081333.809957909] [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.
[gzserver-1] [INFO] [1694081335.182281015] [ailibot_d2_controller]: Wheel pair 1 separation set to [0.325140m]
[gzserver-1] [INFO] [1694081335.183276018] [ailibot_d2_controller]: Wheel pair 1 diameter set to [0.115000m]
[gzserver-1] [INFO] [1694081335.184341736] [ailibot_d2_controller]: Subscribed to [/cmd_vel]
[gzserver-1] [INFO] [1694081335.186874128] [ailibot_d2_controller]: Advertise odometry on [/odom]
[gzserver-1] [INFO] [1694081335.189886092] [ailibot_d2_controller]: Publishing odom transforms between [odom] and [base_footprint]
[gzserver-1] [INFO] [1694081335.201464472] [bytes_joint_state]: Going to publish joint [wheel_left_joint]
[gzserver-1] [INFO] [1694081335.202114651] [bytes_joint_state]: Going to publish joint [wheel_right_joint]
[gzserver-1] [INFO] [1694081335.237499690] [GazeboRealsenseNode]: Realsense Gazebo ROS plugin loading.
[gzserver-1]
[gzserver-1] RealSensePlugin: The realsense_camera plugin is attach to model ailibot2
[gzserver-1] [INFO] [1694081335.296541972] [GazeboRealsenseNode]: Loaded Realsense Gazebo ROS plugin.
[gzclient -2] context mismatch in svga_surface_destroy
[gzclient -2] context mismatch in svga_surface_destroy
- 效果图如下:
- 查看话题
$ ros2 topic list
/camera/color/camera_info
/camera/color/image_raw
/camera/color/image_raw/compressed
/camera/depth/camera_info
/camera/depth/image_rect_raw
/camera/depth/image_rect_raw/compressed
/camera/infra1/camera_info
/camera/infra1/image_raw
/camera/infra1/image_raw/compressed
/camera/infra2/camera_info
/camera/infra2/image_raw
/camera/infra2/image_raw/compressed
/clock
/cmd_vel
/imu/data
/joint_states
/odom
/parameter_events
/performance_metrics
/robot_description
/rosout
/scan
/sensor/sonar_front
/tf
/tf_static
- 查看对应的tf树
$ ros2 run rqt_tf_tree rqt_tf_tree
- 效果图如下:
获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号