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

How can I run a ROS service when my app starts?

asked 2019-10-11 01:14:42 -0600

ros.beginner gravatar image

I have a C# application and I need to add a record and play function for the bag files. I was done creating the service client for these two functions. I can get the list of bag files on my local directory and was also able to play a selected bag file as well. However, I need to manually start the service on a terminal, because without doing so, I get an error that my service "/bag_server" is not available at ROS master.

running service for bag List:

ubuntu@test:~/rosbag/src$ rosrun service_pkg baglist.py
[INFO] [WallTime: 1570761469.491990] rosbag list provider started...

running service for rosbag playback

ubuntu@test:~/rosbag/src$ rosrun service_pkg baglist.py
[INFO] [WallTime: 1570761469.491990] rosbag playback started...

We also had an sdk where ROS is configured. I am quite thinking of adding a configuration on sdk but I am unsure where to start to. Any help would be highly appreciated.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-10-11 03:02:00 -0600

occonni gravatar image

updated 2019-10-11 03:03:25 -0600

You should try to do that with a launch file. There you can automatically start multiple nodes and do some things (like play rosbag) in a certain order. Via the cmd roslaunch you start that launch-file which automatically starts the master.

edit flag offensive delete link more

Comments

Hi, thanks for your response. So after creating a launch file, I need to call this launch file through roslaunch for this to run?

ros.beginner gravatar image ros.beginner  ( 2019-10-11 03:43:30 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2019-10-11 01:14:42 -0600

Seen: 205 times

Last updated: Oct 11 '19