Maritime-Robotics-Student-Society / sailing-robot

Southampton sailing robot
http://www.sotonsailrobot.org
Other
88 stars 46 forks source link

Respawn Xsens node on failure #190

Closed takluyver closed 7 years ago

takluyver commented 7 years ago

Sometimes it fails to connect to the Xsens device. We should ensure it automatically respawns when this happens, rather than us restarting ROS manually.

tsaoyu commented 7 years ago

Respawn option have been set to true for the xsans_driver a simple log show it works is attached below:

[INFO] [1502022664.318867]: Found parameter: ~device, value: auto
[INFO] [1502022664.328829]: Found parameter: ~baudrate, value: 0
[INFO] [1502022664.338702]: Found parameter: ~timeout, value: 0.002
[ERROR] [1502022664.592186]: Fatal: could not find proper MT device.
Unhandled exception in thread started by 
sys.excepthook is missing
lost sys.stderr
[xsens_driver-2] process has finished cleanly
log file: /home/pi/.ros/log/17936d04-7aa3-11e7-9ecd-b827eb9e0baf/xsens_driver-2*.log
[xsens_driver-2] restarting process
process[xsens_driver-2]: started with pid [4065]
[INFO] [1502022669.666491]: Found parameter: ~device, value: auto
[INFO] [1502022669.677938]: Found parameter: ~baudrate, value: 0
[INFO] [1502022669.688140]: Found parameter: ~timeout, value: 0.002
[INFO] [1502022669.972560]: Detected MT device on port /dev/ttyUSB0 @ 115200 bps
[INFO] [1502022669.976407]: MT node interface: /dev/ttyUSB0 at 115200 bd.
[INFO] [1502022670.057074]: Found parameter: ~no_rotation_duration, value: 0
[INFO] [1502022670.069032]: Found parameter: ~frame_id, value: /imu
[INFO] [1502022670.081088]: Found parameter: ~frame_local, value: NED