Real Robot Basic Part 2 Services

Hello, I have a question, I have to launch a file.launch in which it first enters the service so that the robot is located in the correct position to exit and once the service is finished, execute the node that makes it walk through the circuit, I made this .launch file that I am going to show you next, but it only executes the node in which the robot begins to walk through the circuit and the service does not execute it for me. I tested it separately and it worked fine.




<launch>
<include file="$(find scan_test)/launch/scanner_service.launch"/>
<include file="$(find scan_test)/launch/client.launch"/>
        <node pkg='scan_test' type='scanner.py' name= 'scaneo' output='screen'/>

</launch>

Hello @FranROS99, is this issue related to a course? What is the exact name of the course and the name of the unit?
We need that information in order to help you better.

Thanks,

Roberto

Hello, yes this problem is related to the Ros Basic Robot Real project of the Ros course in 5 days with python to obtain the certificate. It is the part where you have to create a launch file that has to have the name main.launch, in which you have to first call the service and once it is finished, in which the robot is going to position itself in the desired place , release the node that makes the robot walk through the circuit. My problem is that with the launch file that I sent you previously, the service does not start for me, but it only launches the node in which the robot begins to walk through the entire circuit.

Is the service server available once you launch the main file? Do you have a client set up somewhere that makes the call to the server maybe before it is available?

If the service is available once I execute the main.launch. This launch file contains the launch file that starts the service, then I include the launch file that calls that service and finally I run the node that makes the robot walk the circuit.

Test that your service works first by running the node with ros2 run and then calling it through the terminal. Then, test running the client node and check for the same behavior.

Only after you are positive your service works, then put only that node in a launch file and check that it works.

I am having some trouble understanding your problem, share some screenshots/screen recordings so we can help more.

Come on, I’m going to do that and let you know but I just want to know, is my.launch file that I uploaded in this post okay?

It looks fine.

See if things change by adding

<?xml version='1.0' ?>

to the first line. Can’t do the project for you though, sorry if that is frustrating

1 Like