Setup
Roscore # Making sure that we had roscore Runningrosrun Turtlesim turtlesim_noderosrun Turtlesim Turtle_teleop_key # now You can use the arrow keys in the keyboard to drive the turtle around.
ROS Topics
sudo Install ros-kinetic-rqtsudoinstall ros-kinetic-rqt-common-pluginsrosrun Rqt_graph Rqt_graph
Rostopic-echoturtle_teleop_key
Rostopic List-h # figure out what argument the list sub--V # displays a verbose list of topics to publish to and Subscribe to and their type
Rostopic Type/turtle1/cmd_vel # You should get the message type of the topic:geometry_msgs/twistrosmsg show Geom Etry_msgs/twist # Look at the details of the message using rosmsg
Using Rostopic Pub
# publishes data on to a topic, rostopic Pub [topic] [Msg_type] [Args]rostopic pub-1/turtle1/cmd_vel Geometry_msgs/twist--'[2.0, 0.0, 0.0]' '[0.0, 0.0, 1.8]'# publishes the velocity commands at a rate of1Hz on the Velocity topicrostopic pub/turtle1/cmd_vel Geometry_msgs/twist-r1--'[2.0, 0.0, 0.0]' '[0.0, 0.0, -1.8]'# now We can also look at what's happeninginchrqt_graph. # and see the data published by our TurtlesimrostopicEcho/turtle1/pose
# how fast theTurtlesim_nodeIs publishing/turtle1/pose, $ rostopic Hz [topic]
Rostopic Hz/turtle1/pose
# Get in depth information about a topic
Rostopic Type/turtle1/cmd_vel | Rosmsg Show
Using Rqt_plot
in/turtle1/pose//turtle1/pose/y and add it.
Ros Entry-level learning (based on ubuntu16.04+kinetic)