OSUrobotics / rosh_core

Fork of defunct rosh_core
http://wiki.ros.org/rosh_core
3 stars 2 forks source link

roshlets cannot have arguments #19

Open felixduvallet opened 8 years ago

felixduvallet commented 8 years ago

I'm trying to write a roshlet that takes in command-line arguments, for example:

rosrun rosh rosh rosh/publishlet.py  --topic /some/topic

However, since all arguments are parsed in the rosh executable, it causes two problems:

  1. any additional arguments break the rosh optionparser.
  2. arguments do not get 'passed down' to the roshlet itself.

Is there a feasible workaround for this?

dlaz commented 8 years ago

Thanks for the issue. I'll look into it as soon as I get a chance.

In the meantime, depending on your specific use case, you can use the parameter server to pass arguments into roshlets:

#!/usr/bin/env rosh
# param.py
print parameters[rospy.get_name()]['foo']()

./param.py _foo:=bar
bar