UbiquityRobotics / ubiquity_motor

Package that provides a ROS interface for the motors in UbiquityRobotics robots
BSD 3-Clause "New" or "Revised" License
25 stars 24 forks source link

Script to read Robot ID #34

Closed rohbotics closed 6 years ago

rohbotics commented 6 years ago

https://github.com/UbiquityRobotics/ubiquity_main/issues/84

Spec

If robot is detect as magni or loki, set the return code to 0, and print magni or loki to stdout.

If no robot detected set return code to 1 and exit. If unknown robot detected set return code to 2 and print the id (ASCII decimal) to stdout.

All other output (debugging/warnings/errors) must be sent on stderr.

@waynegramlich @jim-v Does that look reasonable?

I can implement it.

waynegramlich commented 6 years ago

That will work, but I think we should be thinking ahead.

I would propose that it be done with command line options:

rohbotics commented 6 years ago

Those seem like good forward-thinking additions.

I would still have a non-zero return code for robot platform being none. That way a bash script can do something like:

if ! robot=$(robot_info_script --robot); then
      # Do stuff
      roslaunch $robot foo
else
      # No robot so do nothing
fi
waynegramlich commented 6 years ago

Agreed.