... | ... | @@ -135,15 +135,7 @@ Publishing on a topic |
|
|
|
|
|
At this point, your node is not doing anything interesting. First we will make our node send a message on a topic, we will make it send a velocity on ```/cmd_vel```.
|
|
|
|
|
|
### Python
|
|
|
|
|
|
Before starting, you should study the [official tutorial](https://docs.ros.org/en/galactic/Tutorials/Beginner-Client-Libraries/Writing-A-Simple-Py-Publisher-And-Subscriber.html).
|
|
|
|
|
|
### C+++
|
|
|
|
|
|
Before starting, you should study the [official tutorial](https://docs.ros.org/en/galactic/Tutorials/Beginner-Client-Libraries/Writing-A-Simple-Cpp-Publisher-And-Subscriber.html).
|
|
|
|
|
|
### For both
|
|
|
Before starting, you should study the [official python tutorial](https://docs.ros.org/en/galactic/Tutorials/Beginner-Client-Libraries/Writing-A-Simple-Py-Publisher-And-Subscriber.html) or the [official C++ tutorial](https://docs.ros.org/en/galactic/Tutorials/Beginner-Client-Libraries/Writing-A-Simple-Cpp-Publisher-And-Subscriber.html).
|
|
|
|
|
|
Modify the publisher example to instead publish a ```geometry_msgs/msg/Twist``` (you can import it from ```import geometry_msgs.msg```) with a linear velocity of ```0.1``` and angular velocity of ```0.05```.
|
|
|
|
... | ... | @@ -167,15 +159,7 @@ So that we can run our program this way: |
|
|
ros2 run lab2 lab2_node --ros-args -p linear:=0.5 -p angular:=0.1 -p distance:=0.4
|
|
|
```
|
|
|
|
|
|
### Python
|
|
|
|
|
|
Before starting, you should study the [official tutorial](https://docs.ros.org/en/galactic/Tutorials/Beginner-Client-Libraries/Using-Parameters-In-A-Class-Python.html).
|
|
|
|
|
|
### C++
|
|
|
|
|
|
Before starting, you should study the [official tutorial](https://docs.ros.org/en/galactic/Tutorials/Beginner-Client-Libraries/Using-Parameters-In-A-Class-CPP.html).
|
|
|
|
|
|
### For both
|
|
|
Before starting, you should study the [official python tutorial](https://docs.ros.org/en/galactic/Tutorials/Beginner-Client-Libraries/Using-Parameters-In-A-Class-Python.html) or the [official C++ tutorial](https://docs.ros.org/en/galactic/Tutorials/Beginner-Client-Libraries/Using-Parameters-In-A-Class-CPP.html).
|
|
|
|
|
|
Create a ```linear```, ```angular``` and ```distance``` parameter.
|
|
|
|
... | ... | |