Skip to content

Conversation

@anbit-adhi
Copy link

Addition:

From last year, this package was only for Adaptive LOS guidance. To make a LOS library that supports multiple types of LOS-based guidance and is robust enough to allow adding other guidance systems as well, my primary focus has been to implement more LOS-based methods first. As of now, I have added Proportional LOS and Integral LOS, in addition to the Adaptive LOS from last year.

Restructure:

I have also worked on restructuring the existing Adaptive ROS node and YAML file.

ros_node:
To create a system capable of changing the LOS method in the middle of a mission or segment, I needed to restructure the file named los_guidance_ros.cpp. Previously, this file only ran Adaptive LOS, but now it has been modified so that it can receive a method selection from a service called SetLosMode.srv and switch between all available LOS methods within a single running node. Together with our mentor Anders, we planned how the new structure should look and implemented it accordingly.

A new header file named types.hpp has been added, which holds all the shared data structures used in the code. All parts of the code are now within the same namespace, vortex::guidance::los, making it easier to reference and maintain consistency across different components.

YAML:
The parameter file has been restructured to use the default YAML format. This was done to clearly separate ROS parameters from code-based parameters. The remaining files such as CMakeLists.txt, package.xml, and the launch file have also been updated accordingly.

Test:

There was a test file for Adaptive LOS from last year. Following the same concept, I created equivalent tests for all the new LOS methods. Since there are now multiple test files, I also added a main test file that contains the main function to run all tests together.

For now, if we want to run a single test, it must be done using ROS2 commands in the terminal, but this can be improved later to make it simpler.

All test invocation:
colcon test --packages-select los_guidance --event-handlers console_direct+
colcon test-result --verbose
Example single-test invocation:
colcon test --packages-select los_guidance --ctest-args -R ProportionalLosTest

Plan further:

I plan to run more tests to ensure that all LOS methods work as expected. I also want to make further adjustments so that the ROS node can either remember or reset the Adaptive and Integral values. It would be useful to retain these values within the same segment but reset them when starting a new one.

Lastly, I plan to add more LOS methods, and if time permits, explore creating a library for other types of guidance methods as well.

Summary:

This PR completes the first stage of the LOS guidance library as planned. It introduces two new LOS methods (Proportional LOS and Integral LOS) and provides a clear separation between different methods. Additionally, the ROS2 node has been restructured to support runtime method switching, with updated configuration and the addition of unit tests for each method.

The node is ready to run, it builds and launches, but I still need to perform more testing to confirm that all methods work correctly and continue developing new LOS variants in the next phase.

@chrstrom
Copy link
Member

just a control question, what's the use-case that requires one node to ad-hoc switch the LOS-flavor to use? I'm not too too familiar with the full system / intended use here

Copy link
Contributor

@Andeshog Andeshog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job so far!

Comment on lines +37 to +41
// again i dont know if i should have them here or just in the functions
double pi_h_{};
double pi_v_{};
Eigen::AngleAxisd rotation_y_{0.0, Eigen::Vector3d::UnitY()};
Eigen::AngleAxisd rotation_z_{0.0, Eigen::Vector3d::UnitZ()};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a fair point, and it makes sense to have just have them as input/output for the calculations

Comment on lines 34 to 37

int_h += e.y_e * m_params.time_step;
int_v += e.z_e * m_params.time_step;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sidetracking a bit, but would be cool to have implementations of some common integrators like RK4 and forward euler in vortex-utils that could be used in cases like this👀

@Andeshog
Copy link
Contributor

To fix the build errors you could try to add <depend>yaml-cpp</depend> to your package.xml so that it is (hopefully) installed with rosdep

@anbit-adhi
Copy link
Author

anbit-adhi commented Nov 13, 2025

Thank you @Andeshog for the comments, i will look into all of them after i am done with my exmas.

replying to @chrstrom :
As i have understood the main use-case that requires one node to switch LOS method during runtime is that different types of environment can need different type of methods. And those needs can change while the vehicle is already moving. In theory, Proportional LOS can be suitable for more still water, but if the drone meets a high current Adaptive LOS or integral LOS might be more suitable. Instead of stopping the mission, changing parameters, and relaunching the node, it can come in handy to be able to change LOS methods.
This also allows us to test and find out which LOS method can work in our situations and use that before hand but while testing it will be easier to change methods while we are running the node.

This explanation is from my understanding, so please do correct me if something doesn't feal right!

kluge7 and others added 12 commits January 5, 2026 12:04
* ci(pre-commit): add CI workflow for checking pre-commit hooks

* ci(pre-commit): add hooks for cpp and CMake

* refactor(pre-commit.yml): now uses the workflow on main

* docs(README.md): update status badge for pre-commit

* refactor(ci): move local hooks into a different config file

* docs(README.md): update status badge for pre-commit

* refactor(ci): pre-commit.yml now only runs on pull_request and workflow_dispatch

* ci(pre-commit-local): ignore build/include_order in ament_cpplint since conflict with clang-format

* refactor: fix ament_cpplint and cppcheck warnings

* ci(pre-commit-config-local): increase line length to 120 for ament_cpplint due to some lines being longer

* refactor: fix ament_cpplint and cppcheck warnings

* chore(pre-commit): exclude test dirs from ament_cppcheck to avoid false positives

* ci(pre-commit): update workflow to run on push to main and pull_request
* waypoint mode handling

* update tests with new message

* initial package setup

* ros interface function declaration

* node setup

* working prototype

* reentrant cb, multithreaded

* single threaded impl

* conv threshold action goal

* default thresholdref conv value

* removed switching logic

* removed timer execution

* sim test utils

* waypoint_manager_test setup

* no rendering test arg

* waypoint tests, timeout error

* test refactor

* format

* rename utils package

* test suite and description

* first waypoint test

* removed unused function

* renamed service field to priority. Added simple tests

* waypoint manager readme

* uniform attitude naming convention

* fix pr requests

* update tests with new service fields

* four corner test

* update util func name

* update with new action def

* removed failing build type

* test dependencies

* ignore failing yasmin package

* remove __init__ files

* quat_to_euler in make_pose helper

* added __init__ file

* removed sim deps for test packages

* added action shutdown handling

* removed waypoint manager set setup

* added waypoint manager node tests

* waypoint manager 4 corner sim test

* added missing launch testing test dependency

* add sleep for topic discovery

* fix action member field name

* removed unnecessary if here
* waypoint mode handling

* update tests with new message

* initial package setup

* ros interface function declaration

* node setup

* working prototype

* reentrant cb, multithreaded

* single threaded impl

* conv threshold action goal

* default thresholdref conv value

* removed switching logic

* removed timer execution

* sim test utils

* waypoint_manager_test setup

* no rendering test arg

* waypoint tests, timeout error

* test refactor

* format

* rename utils package

* test suite and description

* first waypoint test

* removed unused function

* renamed service field to priority. Added simple tests

* waypoint manager readme

* uniform attitude naming convention

* fix pr requests

* update tests with new service fields

* four corner test

* update util func name

* update with new action def

* removed failing build type

* test dependencies

* ignore failing yasmin package

* remove __init__ files

* quat_to_euler in make_pose helper

* added __init__ file

* removed sim deps for test packages

* added action shutdown handling

* removed waypoint manager set setup

* added waypoint manager node tests

* waypoint manager 4 corner sim test

* added missing launch testing test dependency

* add sleep for topic discovery

* fix action member field name

* updated to new utils type names

* renamed variables to match types

* update function arg to reflect vortex type

* update variable name in tests

* renamed function arg names
* refactor to new utils ros packages

* added utils dep for velocity controller

* fix typo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants