feat(lifecycle & hw): added serial lib and serial comunication functions with params.

This commit is contained in:
2025-10-29 18:29:10 +01:00
committed by Vincent Winter
parent 8696eee197
commit bd8400027f
8 changed files with 1667 additions and 5 deletions

View File

@@ -40,4 +40,59 @@ You can configure specific database settings in the `docker-compose.yaml` in the
```bash
ros2 launch g2_2025_imu_reader_pkg imu_reader.launch.xml
```
<<<<<<< HEAD
To change parameters when using the launch file it will need to be edited in the `src/g2_2025_imu_reader_pkg/launch` folder. All parameters are already added to this document and thus only the values will need to be changed
=======
To change parameters when using the launch file it will need to be edited in the `src/g2_2025_grade_calculator_pkg/launch` folder. All parameters are already added to this document and thus only the values will need to be changed
### installation and setup for mqtt
```bash
sudo apt install mosquitto
sudo apt-get install libpaho-mqtt-dev
git clone https://github.com/eclipse/paho.mqtt.cpp
cd paho.mqtt.cpp
git co v1.5.4
git submodule init
git submodule update
cmake -Bbuild -H. -DPAHO_WITH_MQTT_C=ON -DPAHO_BUILD_EXAMPLES=ON
sudo cmake --build build/ --target install
```
## for launching lifecycle mqtt node
first:
```bash
ros2 run g2_2025_imu_reader_pkg g2_2025_lifecycle_node --ros-args -p comm_t:='mqtt'
```
in other terminal:
```bash
mosquitto -p 1884
```
and in other terminal to inialize the subsecriber:
```bash
ros2 lifecycle set /lifecycle_manager configure
ros2 lifecycle set /lifecycle_manager activate
```
an finally publish a mesg to the sub in other terminal:
```bash
mosquitto_pub -h localhost -p 1884 -t "esp32/imu" -m "nirvana"
```
close conn via:
```bash
ros2 lifecycle set /lifecycle_manager deactivate
```
>>>>>>> 8b04168 (feat(lifecycle & hw): added mqtt connection and installation setup)