... | ... | @@ -161,7 +161,7 @@ In the previous part, we have created a node that publishes on a topic and makes |
|
|
|
|
|
Check in the Python or C++ tutorial to see how you can subscribe to a topic. You will have to somehow combine together the publisher and subscriber classes. We strongly advise that you follow an incremental approach:
|
|
|
|
|
|
* Add a subscriber to your ```lab2_node```. **You should have a single class**, so add the `subscribe` and `callback` to your existing class. By default, the `spin` function is blocking and accepts a single `node` as an argument.
|
|
|
* Add a subscriber to your ```lab2_node```. **You should have a single class**, so add the `subscribe` and `callback` to your existing class. This is different from the ROS tutorials where the `subscribe` and `callback` are in different classes. By default, the `spin` function is blocking and accepts a single `node` as an argument.
|
|
|
* Add a printout in the callback to check that you receive a message.
|
|
|
* Modify your program so that it exits once the distance has been computed.
|
|
|
|
... | ... | |