공부중
[ROS2] turtlesim 기본 실행 본문
728x90
- 터미널 1
$ ros2 run turtlesim turtlesim_node
- 터미널 2
ye2202@ye2202-HP-Laptop-14s-fq0xxx:~$ ros2 run turtlesim turtle_teleop_key
Reading from keyboard
---------------------------
Use arrow keys to move the turtle.
Use G|B|V|C|D|E|R|T keys to rotate to absolute orientations. 'F' to cancel a rotation.
'Q' to quit.
- 터미널 3
ye2202@ye2202-HP-Laptop-14s-fq0xxx:~$ ros2 node list
/rqt_gui_py_node_58206
/turtlesim
ye2202@ye2202-HP-Laptop-14s-fq0xxx:~$ ros2 topic list
/parameter_events
/rosout
/turtle1/cmd_vel
/turtle1/color_sensor
/turtle1/pose
- 터미널 4
~$ rqt_graph
특정 토픽 확인
~$ ros2 topic echo /turtle1/cmd_vel
위
---
linear:
x: 2.0
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0.0
---
왼쪽 화살표
---
linear:
x: 0.0
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 2.0
---
아래
---
linear:
x: -2.0
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0.0
---
오른쪽 화살표
---
linear:
x: 0.0
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: -2.0
---
Twist 정보 확인
ye2202@ye2202-HP-Laptop-14s-fq0xxx:~$ ros2 interface show geometry_msgs/msg/Twist
# This expresses velocity in free space broken into its linear and angular parts.
Vector3 linear
float64 x
float64 y
float64 z
Vector3 angular
float64 x
float64 y
float64 z
트위스트 토픽을 직접입력해서 동작시키기
~$ ros2 topic pub --once /turtle1/cmd_vel geometry_msgs/msg/Twist "{linear: {x: 0.0, y: 2.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 0.0}}"
publisher: beginning loop
publishing #1: geometry_msgs.msg.Twist(linear=geometry_msgs.msg.Vector3(x=0.0, y=2.0, z=0.0), angular=geometry_msgs.msg.Vector3(x=0.0, y=0.0, z=0.0))
728x90
'프로그래밍 > ROS' 카테고리의 다른 글
[ROS2] turtlesim 동작 (0) | 2024.10.07 |
---|---|
[ROS2] urdf 패키지 만들기 (0) | 2024.10.06 |
[ROS2] 버전 확인 , 터미네이터 설치 (0) | 2024.10.05 |
[ROS2] package not found searching '/opt/ros/humble' (1) | 2024.10.02 |
[ROS2] ROS2의 토픽, 서비스, 액션 (0) | 2024.10.01 |