https://github.com/mbari-org/mbari_wec_template_cpp
C++ template repo for external ROS2-enabled controller for MBARI's wave energy conversion buoy (sim or physical)
https://github.com/mbari-org/mbari_wec_template_cpp
Last synced: 10 months ago
JSON representation
C++ template repo for external ROS2-enabled controller for MBARI's wave energy conversion buoy (sim or physical)
- Host: GitHub
- URL: https://github.com/mbari-org/mbari_wec_template_cpp
- Owner: mbari-org
- License: apache-2.0
- Created: 2023-02-03T18:14:27.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-03T00:27:54.000Z (over 2 years ago)
- Last Synced: 2025-02-04T21:43:18.951Z (11 months ago)
- Language: C++
- Size: 32.2 KB
- Stars: 2
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# mbari_wec_template_cpp
C++ template repo for external ROS2-enabled controller for MBARI's wave energy conversion buoy (sim or physical).
Please also refer to Github's
[template documentation](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template)
Please see [mbari_wec_utils/buoy_api_cpp](https://github.com/osrf/mbari_wec_utils/tree/main/buoy_api_cpp)
for controller [examples](https://github.com/osrf/mbari_wec_utils/tree/main/buoy_api_cpp/examples)
## Modify template for your package
Replace `mbari_wec_template_cpp` with your package name in
- package.xml
- CMakeLists.txt
- launch/controller.launch.py
- all `#include` paths for `controller.hpp` and `control_policy.hpp`
and rename the folder `include/mbari_wec_template_cpp` containing `controller.hpp` and `control_policy.hpp`
Modify `CMakeLists.txt` as desired and add any rosdep dependencies in `package.xml`.
## Implement Controller
Assuming you have followed the above and renamed everything from `mbari_wec_template_cpp` to your package name,
the following files are stubbed out to implement your custom external controller:
- `include//controller.hpp`
- `include//control_policy.hpp`
- `src/controller.cpp`
You may also use `config/controller.yaml` for any policy parameters.
If you modify the controller node name, i.e. `rclcpp::spin(std::make_shared("controller"));`
and the `name` field of `Node` in the launch file,
please be sure to update the first line of the `config/controller.yaml` file and to use the same node name.
Also, if you choose a more specific name for your controller,
consider renaming:
- `launch/controller.launch.py`
- `config/controller.yaml`
- `include//controller.hpp`
- `include//control_policy.hpp`
- `src/controller.cpp`
and update:
- `CMakeLists.txt`
- `executable` field of `Node` in `launch/controller.launch.py`
accordingly.