ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Hi I don't know weather this solves your problem. But please trie first to solve you itends:
def where1(msg):
global x1
x1 = msg.data
def where2(msg):
global y1
y1 = msg.data
def ground():
global cmd
cmd = rospy.Publisher("/atrv/motion", Twist)
rospy.init_node("ground")
rospy.Subscriber("/box_positiona", Float64, where1)
rospy.Subscriber("/box_positionb", Float64, where2)
print x1 # <-- *here* !!!!
print y1 # <-- *here* !!!!
rospy.spin() # this will block untill you hit Ctrl+C
if __name__ == '__main__':
ground() # <-- *and here* !!!!
2 | No.2 Revision |
Hi
I don't know weather whether this solves your problem. But please trie try first to solve you itends:spacing:
def where1(msg):
global x1
x1 = msg.data
def where2(msg):
global y1
y1 = msg.data
def ground():
global cmd
cmd = rospy.Publisher("/atrv/motion", Twist)
rospy.init_node("ground")
rospy.Subscriber("/box_positiona", Float64, where1)
rospy.Subscriber("/box_positionb", Float64, where2)
print x1 # <-- *here* !!!!
print y1 # <-- *here* !!!!
rospy.spin() # this will block untill you hit Ctrl+C
if __name__ == '__main__':
ground() # <-- *and here* !!!!