ROS - 8BitsCoding/RobotMentor GitHub Wiki
- ROS ๊ฐ๋ฐํ๊ฒฝ ๊ตฌ์ฑ : Dualbooting์ ํตํ Linux์ค์น ๋ฐ ROS์ค์น ๋ฐฉ๋ฒ
- Qt IDE์ค์น ๋ฐฉ๋ฒ : ROS Qt IDE ์ค์น๋ฐฉ๋ฒ ๋ฐ ๋๋ฒ๊น ๋ฐฉ๋ฒ
-
- ROS2.0 node ์คํ๋ฐฉ๋ฒ :
$ ros2 run <package_name> <executable_file>
- ROS2.0 launch file ๊ตฌ์ฑํ๋ ๋ฐฉ๋ฒ
- ROS2.0 ํจํค์ง ๊ตฌ์ฑ๋ฐฉ๋ฒ :
$ ros2 pkg create my_package --build-type ament_cmake --dependencies rclcpp
- ํจํค์งํ์ธ๋ฐฉ๋ฒ :
$ ros2 pkg list | grep <package_name>
- ์ปดํ์ผ ๋ฐฉ๋ฒ :
$ colcon build --symlink-install --packages-select <package_name>
- ๋ ธ๋ ๊ตฌ์ฑ๋ฐฉ๋ฒ (cpp)
- CMake ์์ ์ฌํญ
- ์์ฑ๋ ๋
ธ๋ ํ์ธ :
$ ros2 node list
Or$ ros2 node info /<node>
- ROS ํ๊ฒฝ๋ณ์ ํ์ธ :
$ export | grep ROS
- ROS2.0 node ์คํ๋ฐฉ๋ฒ :
-
ROS2_03 : publish topic ์์ฑ
- publish์ฉ cpp ํ์ผ ๊ตฌ์ฑ๋ฐฉ๋ฒ
- ์์ฑ๋ topic ํ์ธ ๋ฐฉ๋ฒ :
$ ros2 topic list | grep '/counter'
- ์์ฑ๋ ๋ฉ์์ง ํ์ธ ๋ฐฉ๋ฒ :
$ ros2 msg show <message>
-
ROS2_05 : service ์์ฑ1 <- ์์ฑ ์ค
-
ROS2_06 : service ์์ฑ2 <- ์์ฑ ์ค
-
ROS2_07 : ROS2๋ฅผ ์ด์ฉํ Debugging
- command line debugging
- rviz debugging
- URDF01 : urdfํ์ผ ์์ฑ ๋ฐ ๋ชจ๋ธ ๋ก๋ฉ๋ฐฉ๋ฒ : ๋ก๋ด๋ชจ๋ธ์ ์ด๋ป๊ฒ ๋ง๋ค๊น?
- URDF02 : urdf๋ชจ๋ธ ์์ฑ ์์ : ์์ง์ด๋ ๋ชจ๋ธ์ ๋ง๋ค์ด๋ณด์
- URDF03 : CAD๋ชจ๋ธ ๋ฃ๊ธฐ
- URDF04 : URDF๊ธฐ๋ฅ ์ถ๊ฐ : collision(์ถฉ๋์์ญ), inertia(๋ด์ ), Contact Coefficients(๋ง์ฐฐ๊ณ์)
- URDF05 : Gazebo์ ๋ก๋ด ์ถ๋ ฅ(Spawn)ํ๊ธฐ
- URDF06 : controller ์ถ๊ฐ
- URDF07 : xacro ๋ชจ๋ธ ์ฌ์ฉํ๊ธฐ
- URDF08 : ROS Control์ ๊ดํ์ฌ
- TF00 : TF ๊ฐ์ Setting
- TF01 : TF๋ ๋ฌด์์ธ๊ฐ?
- TF02 : TF๋ณด๋ ๋ฒ
- TF03 : publisher ๊ตฌํ
- TF04 : subscriber ๊ตฌํ
๋ณธ ์์ ๋ ROBOTIS์ OpenManipulator๋ฅผ ์ค๋ช ํ๋ ์์ ์ ๋๋ค.
๊ธฐ๋ณธ์ ์ผ๋ก ์ฐธ์กฐํ ์ฌ์ดํธ๋ ์๋์ ๊ฐ์ต๋๋ค.
- PC ์ ์ ๋ฐ ์์ค์ฝ๋ ํด๋ก
- OpenManipulator Source ๋ถ์
- OpenManipulator source code๊ตฌ์ฑ์ ์ด๋ ๊ฒ ํ ์ด์ ?
์คํ์ ์๋ ๋ช ๋ น์ด๋ฅผ ํตํด์ ์คํํ ์ ์๋ค.
# gazebo launch
$ roslaunch open_manipulator_gazebo open_manipulator_gazebo.launch
# Controller load
$ roslaunch open_manipulator_controller open_manipulator_controller.launch use_platform:=false
# rviz launch
$ roslaunch open_manipulator_description open_manipulator_rviz.launch
# GUI control
$ roslaunch open_manipulator_control_gui open_manipulator_control_gui.launch
# Keyboard control
$ roslaunch open_manipulator_teleop open_manipulator_teleop_keyboard.launch
# MoveIt control
$ roslaunch open_manipulator_controller open_manipulator_controller.launch use_moveit:=true use_platform:=false
๊ฐ launch file ๋ฐ ์ค๋ช
๋ณธ ์์ ๋ ROBOTIS์ Turtlebot3๋ฅผ ์ค๋ช ํ๋ ์์ ์ ๋๋ค.
๊ธฐ๋ณธ์ ์ผ๋ก ์ฐธ์กฐํ ์ฌ์ดํธ๋ ์๋์ ๊ฐ์ต๋๋ค.
- rosserial : udev ํธ์ง
# Remote PC ์์ ์ฌ์ฉ
$ roscore
$ ssh -p <port> <user>@<ip> # Turtlebot3๋ก ์ ์
TB3$ roslaunch turtlebot3_bringup turtlebot3_robot.launch
$ export TURTLEBOT3_MODEL=burger
$ roslaunch turtlebot3_bringup turtlebot3_remote.launch
- turtlebot ์คํ : turtlebot3_robot.launch
- RemotePC ์คํ : turtlebot3_remote.launch - ๋ก๋ด๋ชจ๋ธ ํ๋ผ๋ฏธํฐ์ ์ธ
- OpenCR ์๋์ด๋ ธ ์ฝ๋ ์๋์ด๋ ธ Pub Data : sensor_state, firmware_version, imu, cmd_vel_rc100, odom, joint_states, battery_state, magnetic_field
์๋์ด๋ ธ Sub Data : cmd_vel, sound, motor_power, reset
- ์๋์ด๋ ธ IDE OpenCR ์ ๋ก๋
- OpenCR rosserial TEST
- OpenCR์์๋ ์ด๋ค ๋ฐ์ดํฐ๋ฅผ ๋ฟ๋ฆฌ๋?
- OpenCR TF์ ๊ดํ์ฌ
์ด์ Rviz๋ฅผ ์คํํด๋ณด์.
rosrun rviz rviz -d `rospack find turtlebot3_description`/rviz/model.rviz
# Remote PC ์์ ์ฌ์ฉ
$ roscore
$ ssh -p <port> <user>@<ip> # Turtlebot3๋ก ์ ์
TB3$ roslaunch turtlebot3_bringup turtlebot3_robot.launch
$ export TURTLEBOT3_MODEL=burger
$ roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=gmapping