|
|
|
# Nodes:
|
|
|
|
|
|
|
|
### Run nodes:
|
|
|
|
ros2 run <package_name> <executable_name>
|
|
|
|
|
|
|
|
### Show all running nodes:
|
|
|
|
ros2 node list
|
|
|
|
|
|
|
|
### Access node information (and action info):
|
|
|
|
ros2 node info <node_name>
|
|
|
|
|
|
|
|
|
|
|
|
# Topics:
|
|
|
|
|
|
|
|
### Visualize nodes and topics:
|
|
|
|
rqt_graph
|
|
|
|
|
|
|
|
### Show all active topics (and their type):
|
|
|
|
ros2 topic list -t
|
|
|
|
|
|
|
|
### Show data that is being published on a topic:
|
|
|
|
ros2 topic echo <topic_name>
|
|
|
|
|
|
|
|
### Access topic information:
|
|
|
|
ros2 topic info <topic_name>
|
|
|
|
|
|
|
|
### Show node's structure:
|
|
|
|
ros2 interface show <msg type>
|
|
|
|
|
|
|
|
### Publish data to a topic directly (arguments in YAML):
|
|
|
|
ros2 topic pub <topic_name> <msg_type> '<args>'
|
|
|
|
|
|
|
|
(options e.g.: --once/ --rate 1)
|
|
|
|
|
|
|
|
### View rate at which data is being published:
|
|
|
|
ros2 topic hz <topic_name>
|
|
|
|
|
|
|
|
|
|
|
|
# Services:
|
|
|
|
|
|
|
|
### Show all active services (and their typie):
|
|
|
|
ros2 service list -t
|
|
|
|
|
|
|
|
### Find all the services of a specific type:
|
|
|
|
ros2 service find <type_name>
|
|
|
|
|
|
|
|
### Show service's structure:
|
|
|
|
ros2 interface show <type_name>
|
|
|
|
|
|
|
|
### Call a service (arguments in YAML):
|
|
|
|
ros2 service call <service_name> <service_type> <arguments>
|
|
|
|
|
|
|
|
|
|
|
|
# Parameters:
|
|
|
|
|
|
|
|
### Show parameters belonging to node:
|
|
|
|
ros2 param list
|
|
|
|
|
|
|
|
### Display the type and current value of a parameter
|
|
|
|
ros2 param get <node_name> <parameter_name>
|
|
|
|
|
|
|
|
### Change parameter's value at runtime:
|
|
|
|
ros2 param set <node_name> <parameter_name> <value>
|
|
|
|
|
|
|
|
### Save parameter configuration:
|
|
|
|
ros2 param dump <node_name> > <node_name>.yaml
|
|
|
|
|
|
|
|
### View all of node's current parameter values:
|
|
|
|
ros2 param dump <node_name>
|
|
|
|
|
|
|
|
### Load parameters from a file to an active node:
|
|
|
|
ros2 param load <node_name> <parameter_file>
|
|
|
|
|
|
|
|
### Start node using saved parameter values:
|
|
|
|
ros2 run <package_name> <executable_name> --ros-args --params-file <file_name>
|
|
|
|
|
|
|
|
# Actions:
|
|
|
|
|
|
|
|
### Show all actions (and their type):
|
|
|
|
ros2 action list -t
|
|
|
|
|
|
|
|
### Introspect action:
|
|
|
|
ros2 action info <action_name>
|
|
|
|
|
|
|
|
### Send action goal (values in YAML):
|
|
|
|
ros2 action send_goal <action_name> <action_type> <values>
|
|
|
|
|
|
|
|
# Recording and running back data:
|
|
|
|
|
|
|
|
### Make directory "bag_files" to store saved recordings:
|
|
|
|
mkdir bag_files
|
|
|
|
cd bag_files
|
|
|
|
|
|
|
|
### Record data that is being published to a topic:
|
|
|
|
ros2 bag record <topic_name>
|
|
|
|
|
|
|
|
### Record multiple topics (and change name of file ros2 bag saves to):
|
|
|
|
ros2 bag record -o <bag_file_name> <topic1_name> <topic2_name>
|
|
|
|
|
|
|
|
### Show recording details:
|
|
|
|
ros2 bag info <bag_file_name>
|
|
|
|
|
|
|
|
### Replay the bag_file:
|
|
|
|
ros2 bag play <bag_file_name> |