-
Notifications
You must be signed in to change notification settings - Fork 26
Henrik/velocity control #641
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
Closed
Closed
Changes from all commits
Commits
Show all changes
118 commits
Select commit
Hold shift + click to select a range
ab3bd3a
added Node, publisher, launch file, config file
Henrimha 23fea72
added subscriber with topic in config
Henrimha 1d1cb53
Added hpp file
Henrimha 60dbb72
added subscriber to current velocity and pitch maybe
Henrimha 252ec54
Changed parameter file, topic and subscriber name
Henrimha 58a87f9
Made PI regulator, able to plot the thrust
Henrimha 2760cbe
Implemented the LQR lib from python
Henrimha fc5d99b
added a PID_controller class
Henrimha b962ad5
changed datatypes, information flow
Henrimha 5e8e77a
New get_paramters function, changed topics in test_node
Henrimha 2fb9d91
nye versjonen av guidance
40eb88f
fixed code so that it likely could compile if I had Drake. Made a Uti…
Henrimha 9141eca
Removed Drake, Changed from std::vector to Eigen in LQR
Henrimha 064adef
los test
7019787
Implemented LQR solver, SLICOT call and some dimension mistakes
Henrimha bbd8564
merging origin/main into anbit/guidance
e6ae145
Resolve stash conflicts: keep my YAML; keep main's joystick node
4d22267
fixing my error
3f3e671
maths behind proportional LOS
2688e27
refactor: change los structure
798542a
refactor: remove unused los package
3bb8926
fix: fix ignore lib
3afca97
Fixed LQR_solve_k_p
Henrimha 2f6c253
Changed LQR test file, it works
Henrimha 9ec7fd4
Changed launch file, fixed QoS problem and changed ouput topic
Henrimha b7f63a9
Test: add test files for ALos and Plos
ee303e7
complete the restructuring of ros node
c687343
Complete los switchin
314a60b
All changes until christmas
Henrimha 03560cf
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 66b252e
ci: trigger Industrial CI on PRs and main branch pushes
kluge7 a36297a
Add C++ and CMake pre-commit hooks (#568)
kluge7 a10e639
docs: add pre-commit CI badge to README
kluge7 b2e632b
refactor: merge the two pre-commit files to replace the pre-commit-ci…
kluge7 ef96e1e
Feat/waypoint manager (#645)
jorgenfj 8f15552
Refactor/type rename (#647)
jorgenfj 84ae150
refactor to new utils ros packages (#648)
jorgenfj 76da1d9
Added support for vortex utils and changed to using their ssa
Henrimha cb4156b
Fix: Issues from feedback on PR draft
5ce96ef
New parameters for water resistance
Henrimha 1305ea7
removed unneccessary features, added euler angle publisher
Henrimha f5d698a
fixed dumb bugs
Henrimha 524a97e
fix git
b7805ea
Fixed bugs so that it works
Henrimha 8c61007
Start vector Feild LOS & Clean code
294ab77
Adda vector field LOS & Test
edc7185
Start quto-euler for graphing
763f784
Fix emailaddress error for git
anbit-adhi f073936
Fix building error
anbit-adhi 70d0bb3
Clean the code
anbit-adhi 65a37c2
reworked the LQR
Henrimha 7273d43
minor changes to PID
Henrimha ab5a067
added framework for tests
Henrimha 98d4faa
Finished tests for PID, and changed PID
Henrimha 47b5121
Fix build error
anbit-adhi a55e636
added framework for LQR_tests, changed CMake into 2 files(test and no…
Henrimha c79cee8
Fixed integrator, unstability and LQR tests, added repository, other …
Henrimha 5099e51
fixed bug and crash in LQR test
Henrimha 6a13ca1
Fix surge error
anbit-adhi 2baeae8
0;9uMerge branch 'main' into anbit/guidance
anbit-adhi 5d31409
Added NMPC, functioning. Sinus references
Henrimha 2bd2c4e
Add stoping msg publishes when goal reached
anbit-adhi 52c919f
Add a square test script
anbit-adhi 11e8d60
Fix Cmake problome for squaretest
anbit-adhi 30568ab
Fix adaptive param lag
anbit-adhi 73b460c
Add tuning parameters
anbit-adhi bb54545
Merge branch 'main' into anbit/guidance
anbit-adhi 29a5709
merge main updates into this branch
anbit-adhi 76f803e
Add tuned parameters
anbit-adhi 6ecdc9f
Fix vector feild simulation issues
anbit-adhi 4c59e21
Added acados NMPC, ill conditioned needs fixing
Henrimha b71f62c
Merge remote-tracking branch 'origin' into anbit/guidance
anbit-adhi 3a10402
no longer numericly unstable, just numericly wrong
Henrimha 17d89c9
Clean code and readMe draft
anbit-adhi 374230a
ReadMe draft
anbit-adhi 853741d
add changes to readMe file
anbit-adhi 2476ace
Add more stuff in readme-file
anbit-adhi 0f4094a
fix pre-commit issues
anbit-adhi a8bf5b4
Fix pre-commit header issues
anbit-adhi 820694d
Merge remote-tracking branch 'origin' into anbit/guidance
anbit-adhi bdb00db
fix build error
anbit-adhi 1d8df3a
Fixed LQR controller, signs, refactored into scripts folder, tried to…
Henrimha 4beeab0
Changed how one verifies the control output from LQR
Henrimha c8a1da7
Fix issues with new operation_manager
anbit-adhi a2927ad
Add clamp for pitch
anbit-adhi 7f7fdde
Fix some duplicate issues
anbit-adhi f64e566
Fix max_pitch to 55 degres
anbit-adhi 4509286
Merge branch 'main' into anbit/guidance
anbit-adhi 7a39ece
Fix: merge issiue
anbit-adhi 3841172
Merge remote-tracking branch 'origin' into anbit/guidance
anbit-adhi 0431417
Start: Test libraary for los
anbit-adhi ae31273
Merge remote-tracking branch 'origin/Henrik/velocity_control' into au…
anbit-adhi f495f8b
Initial fixes
Henrimha 2e73cff
changed to lifecycle node
Henrimha b6f144b
changed to global parameter file
Henrimha c6a2047
Changed more to global paramter file
Henrimha 4818dae
removed unneccessary parameters
Henrimha ef4517e
Add: Diffrent test scenraios for autopilot test
anbit-adhi 1a9af09
changed State overload with msg_ptr, added reset function, changed re…
Henrimha c4e0770
changed the PID class, better interface and more checks
Henrimha 44de4c7
set new controller in launch file
Henrimha 77c69e2
Merge remote-tracking branch 'origin' into Henrik/velocity_control
Henrimha 17b261c
changed autopilot global launch file to Composable Node
Henrimha 94b1d70
changed launch files, works now
Henrimha 5b68001
minor bug fixes
Henrimha b29e76d
untracked som files
Henrimha ff2cdc5
added autostart and odometry dropout checks
Henrimha 07b3737
seperate config files for seperate drones, and PID parameters from co…
Henrimha 0acc8cb
preparing to merge changes to autopilot branch and branch for pushing…
Henrimha 32a51d2
more changes to prepare for merges
Henrimha a06855f
more changes to prepare for merges
Henrimha 7ec9873
Add: Slowing down while reaching the goal
anbit-adhi 52b958b
idk what this is
Henrimha b9e2d8a
Autopilot new start
anbit-adhi b61a37a
new fixes
Henrimha 3e6f6f1
fixed error calculation, and NED to body calculation
Henrimha df6aab0
Some cleanup in LQR, ros, and added PID external error
Henrimha 182688f
changed the file system so that test files is only built when testing
Henrimha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+5.33 KB
.cache/clangd/index/acados_sim_solver_auv_model.c.53A9281F3B2EA7B4.idx
Binary file not shown.
Binary file added
BIN
+3.45 KB
.cache/clangd/index/acados_sim_solver_auv_model.h.995A50C901E2AF1C.idx
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+2.65 KB
.cache/clangd/index/auv_model_impl_dae_fun_jac_x_xdot_u.c.6132B1FDE79246FD.idx
Binary file not shown.
Binary file added
BIN
+2.73 KB
.cache/clangd/index/auv_model_impl_dae_fun_jac_x_xdot_u_z.c.ED4BE4E791391EA0.idx
Binary file not shown.
Binary file added
BIN
+2.65 KB
.cache/clangd/index/auv_model_impl_dae_fun_jac_x_xdot_z.c.59CA37EE71B4BA5D.idx
Binary file not shown.
Binary file added
BIN
+2.71 KB
.cache/clangd/index/auv_model_impl_dae_jac_x_xdot_u_z.c.A6D29D52260DC082.idx
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| cmake_minimum_required(VERSION 3.8) | ||
| project(velocity_controller) | ||
|
|
||
| set(CMAKE_CXX_STANDARD 20) | ||
| set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||
|
|
||
| if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
| add_compile_options(-Wall -Wextra -Wpedantic) | ||
| endif() | ||
|
|
||
|
|
||
| # find dependencies | ||
| find_package(ament_cmake REQUIRED) | ||
| find_package(rclcpp REQUIRED) | ||
| find_package(rclcpp_lifecycle REQUIRED) | ||
| find_package(lifecycle_msgs REQUIRED) | ||
| find_package(std_msgs REQUIRED) | ||
| find_package(vortex_msgs REQUIRED) | ||
| find_package(vortex_utils REQUIRED) | ||
| find_package(Eigen3 REQUIRED) | ||
| #find_package(CasADi REQUIRED) | ||
| find_package(geometry_msgs REQUIRED) | ||
| find_package(nav_msgs REQUIRED) | ||
| find_package(ct_optcon REQUIRED) | ||
| find_package(ct_core REQUIRED) | ||
| find_package(casadi REQUIRED) | ||
|
|
||
| set(ACADOS_ROOT "$ENV{ACADOS_SOURCE_DIR}" CACHE PATH "acados root") | ||
| include_directories( | ||
| ${ACADOS_ROOT}/include | ||
| ${ACADOS_ROOT}/include/acados | ||
| ${ACADOS_ROOT}/include/acados/ocp_nlp | ||
| ${ACADOS_ROOT}/include/acados_c | ||
| ${ACADOS_ROOT}/include/blasfeo/include | ||
| ${ACADOS_ROOT}/include/hpipm/include | ||
| ${ACADOS_ROOT}/include/qpOASES_e | ||
| ${CMAKE_CURRENT_SOURCE_DIR}/scripts/build_auv_solver | ||
|
|
||
| include | ||
|
|
||
| ) | ||
| link_directories(${ACADOS_ROOT}/lib) | ||
|
|
||
|
|
||
| # After setting ACADOS_ROOT etc. | ||
| file(GLOB_RECURSE GEN_SRCS | ||
| ${CMAKE_CURRENT_SOURCE_DIR}/scripts/build_auv_solver/*.c | ||
| ${CMAKE_CURRENT_SOURCE_DIR}/scripts/build_auv_solver/*/*.c | ||
| ) | ||
|
|
||
|
|
||
|
|
||
| add_library(auv_nmpc STATIC | ||
| src/NMPC_acados.cpp | ||
| ${GEN_SRCS} | ||
| ) | ||
|
|
||
|
|
||
| add_executable(velocity_controller_node | ||
| src/velocity_controller.cpp | ||
| src/PID_setup.cpp | ||
| src/LQR_setup.cpp | ||
| src/utilities.cpp | ||
| src/ct_instantiations.cpp | ||
| src/NMPC_setup.cpp | ||
| #src/NMPC_acados.cpp | ||
| ) | ||
|
|
||
|
|
||
|
|
||
| #add_executable(test_LQR_node | ||
| # src/LQR_test.cpp | ||
| # src/LQR_setup.cpp | ||
| # src/utilities.cpp | ||
| # src/ct_instantiations.cpp | ||
| # ) | ||
| ament_target_dependencies(velocity_controller_node | ||
| rclcpp | ||
| rclcpp_lifecycle | ||
| lifecycle_msgs | ||
| std_msgs | ||
| vortex_msgs | ||
| geometry_msgs | ||
| # CasADi | ||
| nav_msgs | ||
| vortex_utils | ||
| ) | ||
| #target_include_directories(velocity_controller_node PRIVATE casadi Eigen3) | ||
| target_link_libraries(auv_nmpc acados hpipm blasfeo qpOASES_e m) | ||
| target_link_libraries(velocity_controller_node Eigen3::Eigen casadi::casadi ct_optcon ct_core auv_nmpc) | ||
| install(TARGETS | ||
| velocity_controller_node | ||
| DESTINATION lib/${PROJECT_NAME} | ||
| ) | ||
|
|
||
| install( | ||
| DIRECTORY include/ | ||
| DESTINATION include | ||
| ) | ||
|
|
||
| install(DIRECTORY | ||
| launch | ||
| config | ||
| DESTINATION share/${PROJECT_NAME}/ | ||
| ) | ||
| if(BUILD_TESTING) | ||
| add_subdirectory(tests) | ||
| endif() | ||
|
|
||
|
|
||
|
|
||
|
|
||
| ament_package() | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| /**: | ||
| ros__parameters: | ||
|
|
||
| PID_params: | ||
| surge: [300.0,10.0,5.0] | ||
| pitch: [60.0,8.0,12.0] | ||
| yaw: [10.0,1.0,5.0] | ||
|
|
||
| LQR_params: | ||
| Q: [200.0,32.84,32.84,15.0,15.0,100.0,32.84,32.84] | ||
| R: [0.02,3.1,3.10] | ||
| NMPCA_params: | ||
| Q: [1.0,1.0,1.0,5.0,5.0] # u,q,r,theta,psi | ||
| R: [0.1,0.1,0.1] # u_surge, u_theta, u_psi | ||
| N: 20 | ||
| NMPC_params: | ||
| Q: [100.0,0.0,0.0,0.0,1.0,1.0,0.0,5.0,50.0] # u,q,r,theta,psi | ||
| R: [0.1,0.1,0.1] # u_surge, u_theta, u_psi | ||
| N: 20 | ||
| #inertia_matrix: [ 30.0, 0.0, 0.0, 0.0, 0.0, 0.60, 0.0, 30.0, 0.0, 0.0, -0.60, 0.30, 0.0, 0.0, 30.0, 0.60, 0.30, 0.0, 0.0, 0.0, 0.60, 0.68, 0.0, 0.0, 0.0, -0.60, 0.30, 0.0, 3.32, 0.0, 0.60, 0.30, 0.0, 0.0, 0.0, 3.34] | ||
| dampening_matrix_low: [23.0,0.0,0.0,0.0,0.0,0.0, 0.0,46.0,0.0,0.0,0.0,0.0, 0.0,0.0,46.0,0.0,0.0,0.0, 0.0,0.0,0.0,46.0,0.0,0.0, 0.0,0.0,0.0,0.0,46.0,0.0, 0.0,0.0,0.0,0.0,0.0,46.0] | ||
| dampening_matrix_high: [1.0,0.0,0.0,0.0,0.0,0.0, 0.0,1.0,0.0,0.0,0.0,0.0, 0.0,0.0,1.0,0.0,0.0,0.0, 0.0,0.0,0.0,1.0,0.0,0.0, 0.0,0.0,0.0,0.0,1.0,0.0, 0.0,0.0,0.0,0.0,0.0,1.0] | ||
|
|
||
| publish_rate: 100 #ms | ||
| #Clamp parameter | ||
| max_force: 99.5 | ||
| controller_type: 2 #1 PID 2 LQR 3 NMPC 4NMPC fast | ||
|
|
||
| #Q: [300.0,0.01,0.01,0.01,32.84,32.84,32.84,32.84,32.84] # u,v,w,p,q,r,phi,theta,psi | ||
| # R: [0.02,3.1,3.10] # u_surge, u_theta, u_psi | ||
|
|
||
| #Fixes: reduce oscillations, follows angles close to wrap around, model restoring forces in pitch, test different references, try to find out why the fuck it went backwards?, | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| /**: | ||
| ros__parameters: | ||
|
|
||
| PID_params: | ||
| surge: [300.0,10.0,5.0] | ||
| pitch: [60.0,8.0,12.0] | ||
| yaw: [10.0,1.0,5.0] | ||
|
|
||
| LQR_params: | ||
| #Q: [200.0,62.84,62.84,15.0,15.0,10.0,3.84,3.84] | ||
| #R: [8.0,100.0,100.0] | ||
| Q: [200.0,32.84,32.84,15.0,15.0,100.0,32.84,32.84] | ||
| R: [0.02,3.1,3.10] | ||
| NMPCA_params: | ||
| Q: [1.0,1.0,1.0,5.0,5.0] # u,q,r,theta,psi | ||
| R: [0.1,0.1,0.1] # u_surge, u_theta, u_psi | ||
| N: 20 | ||
| NMPC_params: | ||
| Q: [100.0,0.0,0.0,0.0,1.0,1.0,0.0,5.0,50.0] # u,q,r,theta,psi | ||
| R: [0.1,0.1,0.1] # u_surge, u_theta, u_psi | ||
| N: 20 | ||
| dampening_matrix_low: [23.0,0.0,0.0,0.0,0.0,0.0, 0.0,46.0,0.0,0.0,0.0,0.0, 0.0,0.0,46.0,0.0,0.0,0.0, 0.0,0.0,0.0,46.0,0.0,0.0, 0.0,0.0,0.0,0.0,46.0,0.0, 0.0,0.0,0.0,0.0,0.0,46.0] | ||
| dampening_matrix_high: [1.0,0.0,0.0,0.0,0.0,0.0, 0.0,1.0,0.0,0.0,0.0,0.0, 0.0,0.0,1.0,0.0,0.0,0.0, 0.0,0.0,0.0,1.0,0.0,0.0, 0.0,0.0,0.0,0.0,1.0,0.0, 0.0,0.0,0.0,0.0,0.0,1.0] | ||
|
|
||
| publish_rate: 100 #ms | ||
| #Clamp parameter | ||
| max_force: 99.5 | ||
| controller_type: 2 #1 PID 2 LQR 3 NMPC 4NMPC fast | ||
|
|
||
| #Q: [300.0,0.01,0.01,0.01,32.84,32.84,32.84,32.84,32.84] # u,v,w,p,q,r,phi,theta,psi | ||
| # R: [0.02,3.1,3.10] # u_surge, u_theta, u_psi | ||
|
|
||
| #Fixes: reduce oscillations, follows angles close to wrap around, model restoring forces in pitch, test different references, try to find out why the fuck it went backwards?, | ||
|
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
For the top-level CMakeLists: There should be some slides somewhere in the C++ learning materials that covers this, but TLDR: