-
Notifications
You must be signed in to change notification settings - Fork 25
/
notepad.txt
122 lines (86 loc) · 4.42 KB
/
notepad.txt
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
## Create Package
```
.gazebo + .xacro => .urdf
```
## Notepad
```
rosdep install -i --from-path src --rosdistro foxy -y
ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args -r __ns:=/skidbot
ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args -r __ns:=/diffbot
ros2 bag record -a -o skidbot_record
ros2 bag play skidbot_record
ros2 launch gcamp_gazebo gcamp_world.launch.py
ros2 launch gcamp_gazebo maze_world.launch.py
ros2 launch gcamp_gazebo skidbot_description.launch.py
ros2 launch gcamp_gazebo diffbot_description.launch.py
```
## rclpy Examples
```
ros2 run py_topic_pkg cmd_vel_pub_node
ros2 run py_topic_pkg laser_raw_node
ros2 run py_topic_pkg laser_sub_node
ros2 run py_topic_pkg parking_node
ros2 interface show custom_interfaces/srv/AddThreeInts
# "rosfoxy" required after custom msg/srv build
ros2 run py_service_pkg gazebo_model_spawner
ros2 run py_service_pkg robot_turning_server
ros2 service call /turn_robot custom_interfaces/srv/TurningControl "{time_duration: 5, angular_vel_z: 1.0, linear_vel_x: 0.5}"
ros2 service call /delete_entity gazebo_msgs/srv/DeleteEntity "{name: 'skidbot'}"
ros2 run py_service_pkg robot_turning_client
ros2 run py_action_pkg fibonacci_action_server
ros2 run py_action_pkg fibonacci_action_client
ros2 run py_action_pkg fibonacci_action_server_cancel
ros2 run py_action_pkg fibonacci_action_client_cancel
ros2 action send_goal fibonacci custom_interfaces/action/Fibonacci "{order: 5}"
ros2 action send_goal --feedback fibonacci custom_interfaces/action/Fibonacci "{order: 5}"
ros2 run image_view image_view --ros-args --remap /image:=/diffbot/camera_sensor/image_raw
ros2 run py_action_pkg img_subscriber_node
ros2 run py_action_pkg odom_sub_node
ros2 run py_action_pkg robot_controller
ros2 run py_action_pkg maze_action_server
ros2 run py_action_pkg maze_action_client
ros2 action send_goal --feedback maze_action custom_interfaces/action/Maze "{turning_sequence: [2,1,0,1,2]}"
ros2 pkg create --build-type ament_python py_first_pkg --dependencies rclpy
ros2 pkg create --build-type ament_python py_topic_pkg --dependencies rclpy sensor_msgs geometry_msgs
ros2 pkg create --build-type ament_python py_service_pkg --dependencies rclpy gazebo_msgs
ros2 pkg create --build-type ament_python py_action_pkg --dependencies rclpy gazebo_msgs custom_interfaces image_transport cv_bridge sensor_msgs std_msgs opencv2
ros2 interface show geometry_msgs/msg/Twist
s
$ ros2 pkg create my_python_pkg --build-type ament_python rclpy
$ ros2 pkg create my_cpp_py_pkg --build-type ament_cmake
```
## rclcpp Examples
```
ros2 run cpp_first_pkg simple_node
ros2 run cpp_first_pkg simple_loop_node
ros2 run cpp_first_pkg simple_oop_node
ros2 run cpp_first_pkg lifecycle_node
ros2 run cpp_topic_pkg cmd_vel_pub_node
ros2 run cpp_topic_pkg laser_sub_node
ros2 run cpp_topic_pkg parking_node
ros2 run cpp_service_pkg basic_server
ros2 run cpp_service_pkg basic_client 1 3
ros2 run cpp_service_pkg robot_turning_server
ros2 run cpp_service_pkg robot_turning_client 5 0.5 1.0
ros2 service call /turn_robot custom_interfaces/srv/TurningControl "{time_duration: 5, angular_vel_z: 1.0, linear_vel_x: 0.5}"
ros2 run cpp_action_pkg fibonacci_action_server_node
ros2 run cpp_action_pkg fibonacci_action_client_node
ros2 run cpp_action_pkg fibonacci_action_server_oop_node
ros2 run cpp_action_pkg fibonacci_action_client_oop_node
ros2 interface show example_interfaces/srv/AddTwoInts
ros2 interface show custom_interfaces/srv/TurningControl
ros2 pkg create --build-type ament_cmake cpp_topic_pkg --dependencies rclcpp sensor_msgs geometry_msgs
ros2 pkg create --build-type ament_cmake cpp_service_pkg --dependencies rclcpp gazebo_msgs geometry_msgs custom_interfaces
ros2 pkg create --build-type ament_cmake cpp_action_pkg --dependencies rclcpp rclcpp_action rclcpp_components custom_interfaces
ros2 pkg create --dependencies action_tutorials_interfaces rclcpp rclcpp_action rclcpp_components -- action_tutorials_cpp
ros2 pkg create --build-type ament_cmake cpp_srvcli --dependencies rclcpp example_interfaces
ros2 pkg create --build-type ament_cmake custom_interfaces
```
https://answers.ros.org/question/302037/ros2-how-to-call-a-service-from-the-callback-function-of-a-subscriber/
## For Windows Users
```
colcon build --symlink-install --packages-select gcamp_gazebo
colcon build --symlink-install --packages-select py_action_pkg
install\setup.bat
ros2 launch gcamp_gazebo gcamp_world_windows.launch.py
```