$ ros2 run <package_name> <node_name> # run a node
e.g.:
$ ros2 run turtlesim turtlesim_node
$ ros2 run turtlesim turtle_teleop_key
$ ros2 node list # list all the running nodes
$ ros2 node info <node_name> # check the info of a node
publisher & subscriber -- for communication
$ rqt_graph # visualize the relationship between publishers and subscribers
$ ros2 topic list # list all the running topics
$ ros2 topic info <topic_name> #check the info of a topic
$ ros2 topic echo <topic_name> # display the data being published on this topic right now
$ ros2 topic hz <topic_name> # how many messages being published on this topic per second
Create an ROS workspace:
$ mkdir -p my_ws/src
~ my_ws/src $ git clone <repository>
~/my_ws $ colcon build
~/my_ws $ source install/
Create an ROS package
~/my_ws $ ros2 pkg create --build-type ament_<programming_language> <package_name>