ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to start a ROS image_raw subscriber python code in boot up

asked 2020-10-05 11:42:43 -0500

srkp gravatar image

I am a using ROS Noetic in ubuntu 20.04. I am creating an application to read camera and save . i have two launch files to read camera and publish to ros, then I created two python codes to subscribe this two topics and save to file.

First two nodes with publishing is starting on bootup with two scripts and this script files are calling from systemctl. This scripts are working and i am getting images in image_view.

I created two new services, which are calling scripts to start my python code to save videos. But when i am starting this script file from systemctl, i am getting error:

أكت 05 20:38:37 atc8110 dt_ros_usb_recording.sh[30768]: 2020-10-05 20:38:37 [DT] Ros CAM USB recording script is starting أكت 05 20:38:37 atc8110 dt_ros_usb_recording.sh[30814]: Unable to init server: Could not connect: Connection refused أكت 05 20:38:37 atc8110 python3[30814]: cannot open display: أكت 05 20:38:37 atc8110 dt_ros_usb_recording.sh[30768]: /home/atc8110/dt/services/record/usb/dt_ros_usb_recording.sh: line 15: 30814 Segmentation fault (core dumped) /usr/bin/python3 /home/atc8110/dt/services/record/usb/dt_ros_usb_recording.py

but when i am running this /usr/bin/python3 /home/atc8110/dt/services/record/usb/dt_ros_usb_recording.py from terminal. It is working perfectly

How to fix this ??

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2020-10-12 02:51:02 -0500

srkp gravatar image

I fixed this issue. There was namenewwindow( ) function call in python code. I removed this function for service and issue fixed

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-10-05 11:42:43 -0500

Seen: 268 times

Last updated: Oct 12 '20