#!/usr/bin/env python # Don't forget to chmod +x topic_publisher.py import rospy from std_msgs.msg import Int32 # Make this into a ROS node. rospy.init_node('my_publisher_node') # Prepare to publish topic `counter` pub = rospy.Publisher('counter', Int32, queue_size=10) # sleep at 2 loops per second rate = rospy.Rate(2) count = 0 # loop until ^c while not rospy.is_shutdown(): pub.publish(count) count += 1 rate.sleep() rospy.sleep(0.5)
# top level directories. Once per system. This will already exist. ./catkin_ws /devel /build /src /cosi119_src/ /src /...etc
# Here is an example ./turtlebot3_gazebo /launch turtlebot3_stage_1.launch . . /src run_world.py turtlebot3_drive.cpp ... and other directories CMAkeLists.txt package.xml