Robot_upstart - add launch file


#1

Upon Magni system boot, I need to add some application launch files.

I have been pointed to robot_upstart. I see that there are many instances of “robot_upstart” files & directories within the Magni’s system directory tree. So, I must assume that Ubiquity Robotics includes this in the LUbuntu disk-image.

However, according to the doc’s http://docs.ros.org/jade/api/robot_upstart/html/ which refer to a job called “myrobot” , I can find no corresponding job on the Magni. Perhaps it exists under a different name? Or, is it possible that this is orphaned, unsupported, uninitialized software?

Will it be dangerous to the integrity of the Magni system software for me to install this, using upstart’s script?

Or, is there another Ubiquity way for me to setup launch files on boot?


#2

Can you comment on if there would be a dependency between Magni nodes up and running before the nodes you want to start are running?
Another sort of dependency would be you want your nodes up before Magni has started.
A third and easiest case is there is no dependency at all and they are unrelated in any direct way to Magni nodes AND the nodes are able to wait for ROS to startup which is usually covered by a real ros launch anyway.
Thanks,
Mark


#3

Dependency: I want Magni powered up and ready for “teleop” commands, before I launch my nodes.

The purpose of my nodes are to operate rosserial (over /dev/ttyUSB1) where external ros node lives within a micro-controller, and, another node which communicates with this external node, which consumes various status topics within the system.

A few seconds After Magni’s bringup is completed, I can always launch my two nodes, with-OUT any problems.

I know that at that time (when I type the launch command), Magni-base and -core are are running, plus teleop_twist_joy, joy_node, motor_node, and others are running.

For now, I am looking into adding to the LUbuntu system a delay, followed by a roslaunch command for my two nodes. But, this method makes me feel dirty.


#4

Ok, it is reasonable and just wanted to know that fairly common requirement applied. I asked because I have my own ‘basic’ startup and reset python script I use on many things (non Magni linux things). That is not an option for your needs so i am unable to supply a good answer.

There is an involved but proper way that things start in magni. It can be outlined in a basic way by viewing wiki.ros.org/controller_manager but the devil is in the details and I must allow others to comment on the usage of controller_manager applicable to Magni as I just have only browsed it so do not want to mislead you in any specifics.


#5

Mark, as far as I understand controller_manager is completely separate from this goal. It is a way of dynamically loading plugins for ros control.

As far as running things at boot goes, there are 2 services that run at boot.

  • roscore.service As the name suggests, this runs the ROS Master (roscore)
  • magni-base.service this runs all the core Magni ROS nodes by launching a script in /usr/sbin/magni-base

For running custom code on bootup, I would change /usr/sbin/magni-base to run your own launch file, and have that launch include magni_bringup base.launch.


#6

Hurray! I have this working.

I edited magni-base, and added in two places in this file:
$ sudo nano /usr/sbin/magni-base

One for declaring a ROS ‘source’ ~ (near the top of the file)
source /home/ubuntu/SOMEWHERE_ws/devel/setup.bash

And, the other for the call to my launch file ~(near the bottom of the file)
roslaunch MYpackage MYlaunchfile.launch & ~(Don’t forget this ampersand)
MYPID=$!
log info "… $MYPID…"
echo $MYPID > $log_path/my_launch.pid

(REBOOT) ~ and it works.