walking与Matlab入门教程-查看话题内容
walking与Matlab入门教程-查看话题内容
说明:
- 介绍如何在Matlab查看话题内容
步骤:
- 新开终端,启动底盘
ros2 launch walking_bringup robot.launch.py
打开Matlab软件
设置域ID为2
setenv("ROS_DOMAIN_ID","2")
- 创建ROS2节点
ros2Node = ros2node("/example_node")
- 查看话题,以及对应的消息类型
ros2 topic list -t
Topic MessageType
____________________________________________________________ _____________________________________
{'/active' } {'std_msgs/String' }
{'/camera/accel/imu_info' } {'realsense2_camera_msgs/IMUInfo' }
{'/camera/aligned_depth_to_color/camera_info' } {'sensor_msgs/CameraInfo' }
{'/camera/aligned_depth_to_color/image_raw' } {'sensor_msgs/Image' }
{'/camera/aligned_depth_to_color/image_raw/compressed' } {'sensor_msgs/CompressedImage' }
{'/camera/aligned_depth_to_color/image_raw/compressedDepth'} {'sensor_msgs/CompressedImage' }
{'/camera/aligned_depth_to_color/image_raw/theora' } {'theora_image_transport/Packet' }
{'/camera/color/camera_info' } {'sensor_msgs/CameraInfo' }
{'/camera/color/image_raw' } {'sensor_msgs/Image' }
{'/camera/color/image_raw/compressed' } {'sensor_msgs/CompressedImage' }
{'/camera/color/image_raw/compressedDepth' } {'sensor_msgs/CompressedImage' }
{'/camera/color/image_raw/theora' } {'theora_image_transport/Packet' }
{'/camera/color/metadata' } {'realsense2_camera_msgs/Metadata' }
{'/camera/depth/camera_info' } {'sensor_msgs/CameraInfo' }
{'/camera/depth/color/points' } {'sensor_msgs/PointCloud2' }
{'/camera/depth/image_rect_raw' } {'sensor_msgs/Image' }
{'/camera/depth/image_rect_raw/compressed' } {'sensor_msgs/CompressedImage' }
{'/camera/depth/image_rect_raw/compressedDepth' } {'sensor_msgs/CompressedImage' }
{'/camera/depth/image_rect_raw/theora' } {'theora_image_transport/Packet' }
{'/camera/depth/metadata' } {'realsense2_camera_msgs/Metadata' }
{'/camera/extrinsics/depth_to_color' } {'realsense2_camera_msgs/Extrinsics'}
{'/camera/gyro/imu_info' } {'realsense2_camera_msgs/IMUInfo' }
{'/camera/imu' } {'sensor_msgs/Imu' }
{'/cmd_vel' } {'geometry_msgs/Twist' }
{'/cmd_vel_mux/input/default' } {'geometry_msgs/Twist' }
{'/cmd_vel_mux/input/joystick' } {'geometry_msgs/Twist' }
{'/cmd_vel_mux/input/keyop' } {'geometry_msgs/Twist' }
{'/cmd_vel_mux/input/navigation' } {'geometry_msgs/Twist' }
{'/cmd_vel_mux/input/remote' } {'geometry_msgs/Twist' }
{'/cmd_vel_mux/input/webapp' } {'geometry_msgs/Twist' }
{'/dynamic_joint_states' } {'control_msgs/DynamicJointState' }
{'/imu' } {'sensor_msgs/Imu' }
{'/imu/data_raw' } {'sensor_msgs/Imu' }
{'/imu/mag' } {'sensor_msgs/MagneticField' }
{'/joint_states' } {'sensor_msgs/JointState' }
{'/odom' } {'nav_msgs/Odometry' }
{'/parameter_events' } {'rcl_interfaces/ParameterEvent' }
{'/robot_description' } {'std_msgs/String' }
{'/robot_velocity' } {'geometry_msgs/TwistStamped' }
{'/rosout' } {'rcl_interfaces/Log' }
{'/scan' } {'sensor_msgs/LaserScan' }
{'/tf' } {'tf2_msgs/TFMessage' }
{'/tf_static' } {'tf2_msgs/TFMessage' }
- 查看消息类型属性
ros2 msg show geometry_msgs/Twist
# This expresses velocity in free space broken into its linear and angular parts.
Vector3 linear
Vector3 angular
- 查看消息类型属性
ros2 msg show nav_msgs/Odometry
# This represents an estimate of a position and velocity in free space.
# The pose in this message should be specified in the coordinate frame given by header.frame_id
# The twist in this message should be specified in the coordinate frame given by the child_frame_id
# Includes the frame id of the pose parent.
std_msgs/Header header
# Frame id the pose points to. The twist is in this coordinate frame.
string child_frame_id
# Estimated pose that is typically relative to a fixed world frame.
geometry_msgs/PoseWithCovariance pose
# Estimated linear and angular velocity relative to child_frame_id.
geometry_msgs/TwistWithCovariance twist
演示视频
获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号