Commit d20d26b9 authored by nardavin's avatar nardavin
Browse files

Fixed line endings... Whoops!

parent 6e430d59
No related merge requests found
Showing with 25 additions and 25 deletions
+25 -25
<launch>
<node name="test_node" pkg="shared_demo" type="test_ros.py" output="screen" />
<launch>
<node name="test_node" pkg="shared_demo" type="test_ros.py" output="screen" />
</launch>
\ No newline at end of file
#!/usr/bin/env python
import rospy
from std_msgs.msg import Time
pub = None
def pub_time(timer):
msg = rospy.get_rostime()
pub.publish(msg)
if __name__ == "__main__":
# Intialize node
rospy.init_node('test_ros')
# Create publisher and set up for timer
pub = rospy.Publisher('/current_time', Time, queue_size=10)
rospy.Timer(rospy.Duration(1), pub_time)
rospy.loginfo('I can talk to roscore!')
rospy.loginfo('Publishing current time to /current_time')
# Infinite loop to execute all ros operations
# in this case, it just handles the timer
#!/usr/bin/env python
import rospy
from std_msgs.msg import Time
pub = None
def pub_time(timer):
msg = rospy.get_rostime()
pub.publish(msg)
if __name__ == "__main__":
# Intialize node
rospy.init_node('test_ros')
# Create publisher and set up for timer
pub = rospy.Publisher('/current_time', Time, queue_size=10)
rospy.Timer(rospy.Duration(1), pub_time)
rospy.loginfo('I can talk to roscore!')
rospy.loginfo('Publishing current time to /current_time')
# Infinite loop to execute all ros operations
# in this case, it just handles the timer
rospy.spin()
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment