rospy, import variable from listener [closed]

asked 2017-02-14 04:27:20 -0600

langan gravatar image


I'm new to ROS and to python, so I'm struggling to get some code working.

I have a publisher which sends some coordinates it has (with numpy), and a listener which receives those coordinates, sends them to another function to calculate some stuff, and gives me a variable "modified_coordinates". I need to send this variable to moveit (RVIZ), to make a robot move, but I have no idea how.

To send it to moveit I have a piece of code that connects to a node there and sends the info to the joints of the robot, and the robot should move in simulation. But I cannot run that piece of code in the callback of the listener, so I need to find a way to import "modified_coordinates" to a different script which connects to moveit. However, "import from" does not work in this case, maybe because the listener is always on?? (I need it to be on to receive new coordinates)

Any ideas?

Thanks very much in advance!! :)


edit retag flag offensive reopen merge delete

Closed for the following reason Question does not follow our guidelines for questions. Please see: for more details. by tfoote
close date 2017-02-15 20:33:10.325878


There is not enough information in this question to reproduce your problem.

tfoote gravatar image tfoote  ( 2017-02-15 20:33:05 -0600 )edit