ROS(004: Understanding ROS Topics)

$ roscore

$ rosrun turtlesim turtlesim_node

$ rosrun turtlesim turtle_teleop_key

$ sudo apt install ros-<distro>-rqt

$ sudo apt install ros-<distro>-rqt-common-plugins

$rosrun rqt_graph rqt_graph

 

$ rostopic -h

$ rostopic <TAB>

$ rostopic ech  /turtle1/cmd_vel

$ rostopic list -h

$ rostopic list -v

$ rostopic type /turtle1/cmd_vel

$ rosmsg show geometry_msgs/Twist

$ rostopic pub -1 /turtle1/cmd_vel geometry_msgs/Twist — ‘[2.0, 0.0, 0.0]’ ‘[0.0, 0.0, 1.8]’

$ rostopic pub /turtle1/cmd_vel geometry_msgs/twist -r 1 — ‘[2.0, 0.0, 0.0]’ ‘[0.0, 0.0, 1.8]’

$ rostopic hz /turtle1/pose

$ rostopic type /turtle1/cmd_vel | rosmsgs show

 

$ rosrun rqt_plot rqt-plot

 

 

打赏