-
Notifications
You must be signed in to change notification settings - Fork 24
Anbit/guidance #642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Anbit/guidance #642
Conversation
for more information, see https://pre-commit.ci
|
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 |
Andeshog
left a comment
There was a problem hiding this 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!
| // 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()}; |
There was a problem hiding this comment.
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
|
|
||
| int_h += e.y_e * m_params.time_step; | ||
| int_v += e.z_e * m_params.time_step; | ||
|
|
There was a problem hiding this comment.
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👀
|
To fix the build errors you could try to add |
|
Thank you @Andeshog for the comments, i will look into all of them after i am done with my exmas. replying to @chrstrom : This explanation is from my understanding, so please do correct me if something doesn't feal right! |
* 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
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 --verboseExample single-test invocation:
colcon test --packages-select los_guidance --ctest-args -R ProportionalLosTestPlan 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.