clearpathrobotics / robot_upstart

ROS package of helper functions related to bringing up roslaunch on system startup.
BSD 3-Clause "New" or "Revised" License
196 stars 96 forks source link

python node read serial port for just half of seconds #76

Open GITSHOHOKU opened 5 years ago

GITSHOHOKU commented 5 years ago

Hi Thanks for this wonderful package! I use a python node in roslaunch file to communicate with serial ports on upstart, I did used chown and chgrp on each ttyUSB* like this

KERNELS=="1-3",  MODE:="0666", OWNER:="hkwal", GROUP:="hkwal"
KERNELS=="1-1.1",  MODE:="0666", OWNER:="hkwal", GROUP:="hkwal"  
KERNELS=="1-1.4",  MODE:="0666", OWNER:="hkwal", GROUP:="hkwal"

And set the --user to my login name hkwal, when I start my PC , I saw the log file that said I have start it for just 0.5 seconds and then it was shotdown message like this:

[roslaunch][INFO] 2018-11-30 21:00:12,469: process[robot_startup-2]: start w/ args [[u'/home/hkwal/catkin_model/src/sx_robot/nodes/serial_to_controllor.py', u'__name:=robot_startup', u'__log:=/home/hkwal/NEWDISK/Startlogfile/sx_robot_upstart.log/df47a2bc-f49f-11e8-8aa8-29ac412068f5/robot_startup-2.log']]
[roslaunch][INFO] 2018-11-30 21:00:12,469: process[robot_startup-2]: cwd will be [/home/hkwal/.ros]
[roslaunch][INFO] 2018-11-30 21:00:12,472: process[robot_startup-2]: started with pid [1282]
[roslaunch][INFO] 2018-11-30 21:00:12,472: ... successfully launched [robot_startup-2]
[roslaunch][INFO] 2018-11-30 21:00:12,472: ... launch_nodes complete
[roslaunch.pmon][INFO] 2018-11-30 21:00:12,472: registrations completed <ProcessMonitor(ProcessMonitor-1, started daemon 139705500083968)>
[roslaunch.parent][INFO] 2018-11-30 21:00:12,472: ... roslaunch parent running, waiting for process exit
[roslaunch][INFO] 2018-11-30 21:00:12,472: spin
[roslaunch][ERROR] 2018-11-30 21:00:12,929: [robot_startup-2] process has died [pid 1282, exit code 1, cmd /home/hkwal/catkin_model/src/sx_robot/nodes/serial_to_controllor.py __name:=robot_startup __log:=/home/hkwal/NEWDISK/Startlogfile/sx_robot_upstart.log/df47a2bc-f49f-11e8-8aa8-29ac412068f5/robot_startup-2.log].
log file: /home/hkwal/NEWDISK/Startlogfile/sx_robot_upstart.log/df47a2bc-f49f-11e8-8aa8-29ac412068f5/robot_startup-2*.log
[roslaunch.pmon][INFO] 2018-11-30 21:00:12,929: ProcessMonitor.unregister[robot_startup-2] starting
[roslaunch.pmon][INFO] 2018-11-30 21:00:12,929: ProcessMonitor.unregister[robot_startup-2] complete

Anybodys knows why ! I had disturbed by it for a long time!!! Thanks anyway!

GITSHOHOKU commented 5 years ago

Another information is that when I in my LOGIN name hkwal , I reboot the PC ,it can upstart success , but when I poweroff it and power on PC the python node start failed