-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathROS_commands_and_tips.txt
More file actions
69 lines (51 loc) · 2.06 KB
/
ROS_commands_and_tips.txt
File metadata and controls
69 lines (51 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
------------ ROS 2 Operation -------------
# Initialize turtlebot hardware
# This must happen before doing any other turtlebot operations
ros2 launch turtlebot3_bringup robot.launch.py
# Open a Gazebo sim world
ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py
# Start navigation2
# Requires ~/map.yaml
ros2 launch turtlebot3_navigation2 navigation2.launch.py map:=path/to/map.yaml params_file:=$HOME/ez-turtlebot3/nav2_params.yaml
ros2 launch turtlebot3_navigation2 navigation2.launch.py use_sim_time:=True map:=$HOME/maps/turtle_world.yaml params_file:=$HOME/ez-turtlebot3/nav2_params.yaml # (if in sim)
# Start cartographer
ros2 launch turtlebot3_cartographer cartographer.launch.py # use_sim_time:=True (if in sim)
# Save a map from cartographer
# Cartographer has to think the map is complete, which may take time
ros2 run nav2_map_server map_saver_cli -f ~/path/to/map
# Teleoperation
ros2 run turtlebot3_teleop teleop_keyboard
# Record a ROS 2 bag of all topics
ros2 bag record -o <BAG_NAME> -a
# Play a ROS 2 bag
ros2 bag play <BAG_DIRECTORY>
# Change parameters (temporarily) while robot is running
ros2 param set <node> <param> <value>
------------ ROS 2 Monitoring ---------------
# See topics in a gui
rqt
# See a list of active topics
ros2 topic list
# View messages published to a topic
ros2 topic echo /topic_name
# Check activity of a topic
ros2 topic monitor /topic_name
# See a list of nodes
ros2 node list
# See a list of parameters
ros2 param list <node>
------------ Process Notes --------------
# Record and playback robot behavior (using nav2 in Gazebo as an example)
1. Bring up Gazebo (or turtlebot)
2. Start Nav2
2.5. Set 2D Pose Estimate
3. Begin recording rosbag
4. Perform robot behavior (set a nav goal and wait for robot to reach it)
5. CTR+C to end rosbag recording
6. Close RViz and Gazebo (or simply reset? maybe?)
7. Open RViz with nav2 default topics
8. Play rosbag
# Edit a parameter temporarily while nav2 stack is running
1. list nodes
2. list parameters of node that has behavior you want to change
3. set parameter using ros2 param set