2.8 KiB
Installation
Prerequisites
- ROS2 Jazzy or newer installed (ROS2 Installation Guide)
- CMake (version 3.8+)
- Python 3.8+
- libtomlplusplus-dev
- libpqxx-dev
- Colcon build tool
- Docker compose
Clone the Repository
git clone https://git.wessel.gg/inholland/ros2-assignments.git
cd ros2-assignments
Build the Workspace
colcon build
Any parameters can be changed before building by editing the imu_reader.launch.xml in the launch folder
Source the Workspace
source install/setup.bash
Start the database
sudo docker-compose up
You can configure specific database settings in the docker-compose.yaml in the root folder or the config.toml file in the src/ folder
Start the IMU Reader program
ros2 launch g2_2025_imu_reader_pkg imu_reader.launch.xml
<<<<<<< HEAD
<<<<<<< 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
=======
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
484209c(feat(lifecycle & interface): added docs for arch and testing.)
installation and setup for mqtt
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:
ros2 run g2_2025_imu_reader_pkg g2_2025_lifecycle_node --ros-args -p comm_t:='mqtt'
in other terminal:
mosquitto
and in other terminal to inialize the subsecriber:
ros2 lifecycle list /lifecycle_manager ## for status checking
ros2 lifecycle set /lifecycle_manager configure
ros2 lifecycle set /lifecycle_manager activate
ros2 lifecycle set /lifecycle_manager deactivate
ros2 lifecycle set /lifecycle_manager shutdown
an finally publish a mesg to the sub in other terminal:
mosquitto_pub -h localhost -p 1883 -t "esp32/imu" -m "test"
close conn via:
ros2 lifecycle set /lifecycle_manager deactivate
8b04168(feat(lifecycle & hw): added mqtt connection and installation setup)