< Publisher & Subscriber를 python으로 작성>
참고 동영상) https://youtu.be/izfXL3rIt10
$ mkdir -p catkin_ws/src
$ cd src
$ catkin_create_pkg node_basic std_msgs geometry_msgs rospy
$ cd node_basic
$ mkdir scripts
$ catkin_make
$ roscore
$ rosrun node_basic pulblisher.py
$ rosrun node_basic subscriber.py
참고) https://hagler.tistory.com/155
(8) motor_control 노드 작성
motor_control 노드 #!/usr/bin/env python # license removed for brevity import rospy from std_msgs.msg import UInt16MultiArray pub = rospy.Publisher('cmd_vel',UInt16MultiArray,queue_size=10) cmd_vel..
hagler.tistory.com
*배열을 publisher 하고 Subscriber 하는 방식을 추가 검토
UInt16 -> UInt16MultiArray 로 변경하고
cmd.msg.data[0] <- 이런식으로 배열에 접근
'ROS' 카테고리의 다른 글
[Publish/Subscribe] Publisher & Subscriber with Python (0) | 2021.07.10 |
---|---|
[ROS-GPS] Localization using GPS (0) | 2021.06.25 |
[Following Robot] Jetson-inference & ros_deep_learning (0) | 2021.06.02 |
[Following Robot] Mycobot ROS-6-axis Robot Control (0) | 2021.06.01 |
[Following Robot] Stereo/Monocular Person tracking (0) | 2021.06.01 |