Questions about 4.3 Topics Quiz

Good afternoon:
At the time of solving the exercise “4.3 Topics Quiz” I have managed to publish in the /cmd_vel topic and read the data from the laser sensor in the appropriate positions as a subscriber of the /kobuki/laser/scan topic but I am not able to relate both scripts. Could you help me by giving me some kind of advice. Should I create some kind of own message?
I also don’t know how to configure the launch file so that the node acts both as a publisher and as a subscriber. I thought in the following way but it turned out wrong:

Un saludo y muchas gracias de antemano !

Your best bet it to create the publisher and the subscriber in the same script. You can use Python classes for some added benefits.

With this, you only need to launch one node.


So have you completed the quiz? What do you mean by relating both scripts?

One thing to take into account is that you can create a publisher and a subscriber in the same node. This allows you to say use the laser data to send velocities to the robot.

In the launch file you created, you can see that the name you are giving your nodes is illegal, and it also seems like it can’t find the package you have put your file in. Remember to compile your packages and source the workspace they are in before you launch files within them.