Filozofia ROS'a i podstawowe koncepty
Nowy pusty ROSject na platformie The Construct, z uruchomioną symulacją Turtlebot 3.
Część teoretyczna:
- Filozofia Robot Operating System
- Client libraries
- ROS 1 vs ROS 2
- Gazebo
- Roboty mobilne
Część praktyczna:
- Workspace
- Catkin
- Package
- Node
-
example node
#!/usr/bin/env python3 import rospy rospy.init_node("bit_ros") r = rospy.Rate(10) # 10 hz while not rospy.is_shutdown(): # . . . r.sleep()
- Master
- Topic
- Message
- rostopic
- example publisher
#!/usr/bin/env python3 import rospy from std_msgs.msg import String rospy.init_node("publisher") publisher = rospy.Publisher("/hello_world", String, queue_size=10) r = rospy.Rate(10) while not rospy.is_shutdown(): publisher.publish("Hello World") r.sleep()
- example subscriber
#!/usr/bin/env python3 import rospy from std_msgs.msg import String def callback(msg): print(msg) rospy.init_node("subscriber") subscriber = rospy.Subscriber("/hello_world", String, callback) rospy.spin()
W katalogu /scripts
.