Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 49

import a 'roshlet' from another roshlet

$
0
0
Hi, If I have two rosh scripts - lets say a.py and b.py that work perfectly when invoked independently (rosrun rosh rosh a.py) - is there a simple mechanism for importing one into the other that ensures the globals() have been set up during the import. e.g.,
#### b.py ####

def getpoint():
  return msg.geometry_msg.PointStamped()

#### a.py ####
import b

actions.foo_controller.move_to(b.getpoint())
The problem is that if I 'rosrun rosh rosh a.py', global variables like msg, actions, etc in module a are set up but these do not carry across when I 'import b'. As a result, b will not load (with an error the msg is not defined).

Viewing all articles
Browse latest Browse all 49

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>