Created
June 22, 2018 10:13
-
-
Save RDaneelOlivav/f3726889ec1cf2c7f6bc4b7d57afb665 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# license removed for brevity | |
import rospy | |
from std_msgs.msg import Float32 | |
def talker(): | |
pub = rospy.Publisher('/pexod/vel_cmd', Float32, queue_size=1) | |
rospy.init_node('hexapod_mover_node', anonymous=True) | |
rate = rospy.Rate(1) # 10hz | |
position = Float32() | |
position.data = 0.7 | |
while not rospy.is_shutdown(): | |
rospy.loginfo("Moving Hexapod to position =="+str(position)) | |
pub.publish(position) | |
rate.sleep() | |
position.data *= -1 | |
if __name__ == '__main__': | |
try: | |
talker() | |
except rospy.ROSInterruptException: | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment