Skip to content
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

[Beetle][NMPC] The latest version of real machine #615

Open
wants to merge 546 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
546 commits
Select commit Hold shift + click to select a range
024501d
[Control][MPC] initialize a nmpc controller for qd with a full model …
Li-Jinjie Nov 24, 2023
8115b4e
[Control][MPC] initialize mpc_solver for qd full model
Li-Jinjie Nov 24, 2023
58d7de2
[Control][MPC] change namespace of body_rate nmpc controller, prepari…
Li-Jinjie Nov 24, 2023
cfb08fe
[Beetle] add scripts for analysis
sugihara-16 Nov 25, 2023
a86e134
Merge branch 'develop/Beetle_test' into develop/Beetle
sugihara-16 Nov 25, 2023
8a603a0
[Control][MPC] change the namespace of mpc_solver
Li-Jinjie Nov 25, 2023
23610ac
[Control][MPC] rename under_act_body_rate, polish some files
Li-Jinjie Nov 25, 2023
62b5360
[Control][MPC] polish code for under_act_body_rate, remove unnecessar…
Li-Jinjie Nov 25, 2023
688ce22
[Control][MPC] implement NMPC with the under_act_full_model, achieve …
Li-Jinjie Nov 25, 2023
05a60e7
[Control][MPC] for under_act_full_model, in addition to body_rate, se…
Li-Jinjie Nov 25, 2023
a304065
[aerial_robot_base] add a checker for the main loop's execution time
Li-Jinjie Nov 25, 2023
0afcaed
[Control][MPC] rename the python files for acados code generation; cr…
Li-Jinjie Nov 25, 2023
53a18a8
[Control][MPC] make printing physical parameters a function
Li-Jinjie Nov 27, 2023
a0c08e5
[Beetle] solve some merge conflicts from beetle branch
Li-Jinjie Nov 27, 2023
f68e3c1
[Beetle][MPC]: init python file, not finished yet
Li-Jinjie Nov 28, 2023
c0b9b06
[WIP][Kondo] create kondo servo task in STM32H7
sugihara-16 Nov 29, 2023
3355a69
[Beetle][MPC] init a nmpc controller
Li-Jinjie Nov 29, 2023
9c90142
[Control][MPC] change thrust constraints in takeoff to scaling; modif…
Li-Jinjie Nov 29, 2023
e8c3aa2
[Control][MPC] change thrust constraints in takeoff to scaling (to qd…
Li-Jinjie Nov 29, 2023
d5cff44
[Control][MPC] modify the model definition in acados, try to use more…
Li-Jinjie Nov 30, 2023
ab1aa9c
[Beetle][MPC] finish model definition in python
Li-Jinjie Nov 30, 2023
f369ce1
[Beetle][MPC] over-actuated full model: re move "allow_free" paramete…
Li-Jinjie Dec 4, 2023
42b11ae
[Beetle][MPC] over-actuated model without servo delay: cpp and h file…
Li-Jinjie Dec 5, 2023
64a6d57
[Beetle][MPC] reading params from .yaml directly, as beetle will not …
Li-Jinjie Dec 5, 2023
c0abecf
[Beetle][MPC] add a publisher to pub gimbal control angle. the beetle…
Li-Jinjie Dec 5, 2023
4d25f57
[Beetle][MPC] print weights and constraints when executing python code
Li-Jinjie Dec 5, 2023
764480c
[Control][MPC] make the p gain for body rate controller adjustable fr…
Li-Jinjie Dec 5, 2023
5502679
[Spinal][Kondo] add kondo servo task in stmh7
sugihara-16 Dec 20, 2023
e115bd1
[Control][MPC] fix a typo
Li-Jinjie Dec 21, 2023
b78cf15
[Mocap][Subscriber] explicitly use TcpNoDelay option for ground_truth…
tongtybj Dec 21, 2023
287d0a2
[Control][MPC] remove redundant code for getting attitude
Li-Jinjie Dec 21, 2023
8fd6dd3
[Control][MPC] remove the auto-generated code from git system
Li-Jinjie Dec 22, 2023
f336dcf
[Control][MPC] remove redundant code; make the gains of body rate con…
Li-Jinjie Dec 22, 2023
ec46acc
[Control][MPC] The parameter N_timing seems to be redundant, thus is …
Li-Jinjie Dec 22, 2023
becf3ba
[Control][MPC] make nmpc_over_act_no_servo_delay an independent option.
Li-Jinjie Dec 25, 2023
e725d54
[Control][MPC] finish the first version over_act_full model. Now the …
Li-Jinjie Dec 25, 2023
640287b
[Control][MPC] minor modify
Li-Jinjie Dec 25, 2023
740a649
[Spinal][UART] Enabling DMA for UART3 RX and securing SRAM region for…
sugihara-16 Dec 27, 2023
91974e8
[Spinal][MPU] Assigned part of D1 SRAM region for Kondo servo's dma
sugihara-16 Dec 27, 2023
74c77cd
[Spinal][Kondo] change the structure of the interface from normal per…
sugihara-16 Dec 27, 2023
235f241
[Beetle][Control][NMPC]: refactor no_servo_delay model generation file
Li-Jinjie Dec 27, 2023
be406d6
[Beetle][Control][NMPC]: add closed_loop simulation for no_servo_dela…
Li-Jinjie Dec 27, 2023
ca02b0d
[Beetle][Control][NMPC]: improve plotting code
Li-Jinjie Dec 29, 2023
1d314ec
[Beetle][Control][NMPC]: add closed_loop simulation for full model wi…
Li-Jinjie Dec 29, 2023
d34d28f
[Beetle][Control][NMPC]: update init values of solver
Li-Jinjie Dec 29, 2023
ddc0c3c
[Beetle][Control][NMPC]: over_act_full -> make sim freq higher than c…
Li-Jinjie Dec 29, 2023
f55264a
[Beetle][Control][NMPC]: over_act_full -> modify u cost to punish the…
Li-Jinjie Dec 29, 2023
e5d82e4
[Beetle][Control][NMPC]: change SQP_RTI to SQP after convergence. plo…
Li-Jinjie Dec 30, 2023
f029e39
[Beetle][Control][NMPC]: add position and attitude regulation in sim.…
Li-Jinjie Dec 30, 2023
394ebba
[Beetle][Control][NMPC]: fix a bug for sending gimbal_ctrl_cmd
Li-Jinjie Dec 30, 2023
6ce2c96
[Beetle][Control][NMPC]: identify t_servo (gazebo sim); choose an app…
Li-Jinjie Dec 30, 2023
7c169ac
[Beetle][SYSID]: add identify script for servo delay
Li-Jinjie Dec 30, 2023
8d3100e
[Beetle][Control][NMPC]: add a subscriber to set RPY.
Li-Jinjie Dec 31, 2023
f41c4a5
[Beetle][Control][NMPC]: fix a bug in tau_u_b mathematical model
Li-Jinjie Dec 31, 2023
4b0de32
[Beetle][Control][NMPC]: add ft and servo angle as reference, calcula…
Li-Jinjie Jan 1, 2024
52df905
[Beetle][Control][NMPC]: refactor nmpc_controller, modify the order o…
Li-Jinjie Jan 2, 2024
68ae4d3
[Beetle][Control][NMPC]: python script: choose pseudo inverse to calc…
Li-Jinjie Jan 2, 2024
74e69b7
[Beetle][Control][NMPC]: change a bug in reading model parameters; ch…
Li-Jinjie Jan 2, 2024
cd226f4
[Beetle][Control][NMPC]: calculate target servo_angle and thrust usin…
Li-Jinjie Jan 2, 2024
89998be
[Sys. Id.]: change the position of files
Li-Jinjie Jan 3, 2024
e87df0a
[Beetle][Control][NMPC]: Add a traj. tracking mode. If PredXU msg is …
Li-Jinjie Jan 3, 2024
74ba5f0
[Planning]: init the planning package. the mpc_pt_pub_node.py can sen…
Li-Jinjie Jan 4, 2024
8ae9525
[Beetle][Control][NMPC]: add some safety mechanism: 1. the tracking m…
Li-Jinjie Jan 4, 2024
b1adba3
[Beetle][Planning][NMPC]: Add allocation_matrix_pinv to calculate mor…
Li-Jinjie Jan 4, 2024
787247b
[Beetle][Planning][NMPC]: achieve tracking one circle traj. Note that…
Li-Jinjie Jan 4, 2024
1f0e874
[Beetle][Planning][NMPC]: achieve tracking one circle traj. with diff…
Li-Jinjie Jan 4, 2024
ff97f19
[Beetle][Planning][NMPC]: change demo: set roll=0.5 and track a circl…
Li-Jinjie Jan 4, 2024
94e2f7d
[Beetle][Planning][MPC] refactor code, create a new trajectory class;…
Li-Jinjie Jan 5, 2024
045a3ba
[Control][MPC] fix the bug about rosservice call to spinal
tongtybj Jan 10, 2024
11bb83b
[Beetle][Control][NMPC]: fix the bug about rosservice call to spinal …
Li-Jinjie Jan 15, 2024
321c8e8
[Beetle][Control][NMPC]: remove the special process of slowly increas…
Li-Jinjie Jan 15, 2024
f736297
[Beetle][Control][NMPC]: replace all std::cout to ROS_LOG or ROS_WARN
Li-Jinjie Jan 15, 2024
d9f4a09
[Control][NMPC][Quadrotor]: the p gain for body_rate controller can b…
Li-Jinjie Jan 15, 2024
ee839d5
[Beetle][Spinal] minor fix for successful build
Li-Jinjie Jan 18, 2024
443790d
[Spinal][DShot] add telemetry function for the ESCs that support. The…
Li-Jinjie Jan 20, 2024
5e44045
[Spinal][DShot] add DShot code from https://github.com/mokhwasomssi/s…
Li-Jinjie Jan 20, 2024
f10c516
[Spinal][DShot] add DMA function for DShot PWM. only set the CubeMX a…
Li-Jinjie Jan 20, 2024
1f46874
[Spinal][DShot]: remove redundant code for esc_telem
Li-Jinjie Jan 21, 2024
d5e9b44
[Spinal][DShot]: create the new dshot class
Li-Jinjie Jan 21, 2024
1b45cf8
[Spinal]: allow only thrust cmd now.
Li-Jinjie Jan 21, 2024
d2437c6
[Spinal][DShot]: change the PWM setting in CubeMX for DShot; fix a ty…
Li-Jinjie Jan 21, 2024
2a05720
[Spinal][DShot]: try to change pwm to dshot. Not tested.
Li-Jinjie Jan 21, 2024
70d0eeb
[Spinal][DShot]: fix bugs, now the code can be built without errors.
Li-Jinjie Jan 23, 2024
bdde47e
[Spinal][DShot]: change the memory size for dma buffer. The original …
Li-Jinjie Jan 23, 2024
5b14300
[Spinal][DShot]: only one motor can rotate. do not know why
Li-Jinjie Jan 24, 2024
ac84fb0
[Spinal][DShot]: [SUCCESS] change settings to use NPU. NPU is critica…
Li-Jinjie Jan 25, 2024
3b27fe1
[Spinal][DShot]: add one flag to decide if using telemetry or not.
Li-Jinjie Jan 26, 2024
fb45a41
[Spinal][DShot]: change the UART for receiving dshot telemetry to RX …
Li-Jinjie Jan 26, 2024
a038a78
[Spinal][DShot]: add msg for telemetry
Li-Jinjie Jan 26, 2024
a9e24b3
[Spinal][DShot]: delete escTelemTask. No need to set this task.
Li-Jinjie Jan 26, 2024
69ecd9b
[Spinal][DShot]: achieve dshot telemetry of one motor. test using deb…
Li-Jinjie Jan 26, 2024
a47dbef
[Spinal][DShot]: add code to communicate with ros. tested successfully!
Li-Jinjie Jan 26, 2024
5d1518e
[Spinal][DShot]: refactor dshot class to triggering one by one. teste…
Li-Jinjie Jan 26, 2024
699c1d1
[Spinal][DShot]: refactor esc_telem class to measure one by one. Unsu…
Li-Jinjie Jan 26, 2024
74ab953
Revert "[Spinal][DShot]: refactor esc_telem class to measure one by o…
Li-Jinjie Jan 29, 2024
24028f2
Revert "[Spinal][DShot]: refactor dshot class to triggering one by on…
Li-Jinjie Jan 29, 2024
dd211d7
[Spinal][DShot]: add time stamp to ESCTelemetryArray.msg
Li-Jinjie Jan 29, 2024
0da8d21
[Spinal][DShot]: add esc_reader support for different esc_msgs
Li-Jinjie Jan 29, 2024
ce51be7
[Spinal][DShot]: send telem flag to different motors. one telem for o…
Li-Jinjie Jan 29, 2024
ba2747f
[Spinal][DShot]: finish the eRPM measurement of different motors. Tes…
Li-Jinjie Jan 29, 2024
cb35d01
[Spinal][DShot]: polish the dshot code for rotor measurement
Li-Jinjie Jan 29, 2024
2c3986c
[Spinal][DShot]: add crc to ESCTelemetry.msg for debugging
Li-Jinjie Jan 29, 2024
8674298
[Spinal][DShot]: refactor some names; add constraints for dshot value
Li-Jinjie Jan 30, 2024
ebc4ff4
[Spinal][DShot]: add support to reverse rotation directions. tested!
Li-Jinjie Jan 30, 2024
b51e6c9
[Spinal][DShot]: change telemetry info from erpm to real rpm!
Li-Jinjie Jan 30, 2024
2cab8df
[Motor Test][DShot]: add support for dshot and telemetry
Li-Jinjie Jan 31, 2024
aeff594
[Motor Test][DShot]: set a parameter to choose has_telemetry or not
Li-Jinjie Jan 31, 2024
58984e2
[Motor Test][script]: add a Python script to analyze data
Li-Jinjie Jan 31, 2024
aa62eec
[Motor Test][script]: now the .txt name can be passed in as argument
Li-Jinjie Jan 31, 2024
549b828
[Motor Test][script]: add has_telemetry as an argument
Li-Jinjie Jan 31, 2024
aa1c400
[Spinal]: fix typo
Li-Jinjie Jan 31, 2024
25b0a5a
[Motor Test][DShot]: fix a bug in the launch file. Tested!
Li-Jinjie Jan 31, 2024
0490f54
[aerial_robot_base] modify ~ to ! to express negative; add comment fo…
Li-Jinjie Feb 1, 2024
a95c893
[Beetle][Control][NMPC] refactor yaml files for Beetle control, remov…
Li-Jinjie Feb 1, 2024
917e36b
[Beetle][Control][NMPC] update motor data from the newest motor test
Li-Jinjie Feb 1, 2024
d8fff04
[Motor Test][script] add function to print max thrust and polynomial …
Li-Jinjie Feb 1, 2024
3198723
Merge branch 'develop/spinal/jsk_lib/kondo_for_stm32H7' into develop/…
Li-Jinjie Feb 1, 2024
b4b9a44
[Spinal][DShot]: refactor rx_buf_ to esc_telem_rx_, in case of unambi…
Li-Jinjie Feb 1, 2024
4bcc3cf
[Spinal][Kondo]: fix all errors and build successfully! Tested succes…
Li-Jinjie Feb 1, 2024
11d3af2
[Spinal][DShot]: remove code for dshot config, since unsuccessful
Li-Jinjie Feb 2, 2024
f48889e
[Spinal][Kondo]: change servo_state_msg to joint_state_msg, which use…
Li-Jinjie Feb 2, 2024
6123135
[Spinal][Kondo]: change subscriber type from ServoControlCmd to Joint…
Li-Jinjie Feb 2, 2024
976c010
[Spinal][Kondo]: improve code, making the reading speed to 125hz now.…
Li-Jinjie Feb 5, 2024
a2d903f
[Spinal][Kondo]: change the name of joint_state msg the same as simul…
Li-Jinjie Feb 5, 2024
934c568
[Beetle][Control][NMPC]: make sure that only thrust cmd is used now
Li-Jinjie Feb 5, 2024
3ad67da
[Spinal][Kondo]: refactor the kondo_servo code, separate the original…
Li-Jinjie Feb 5, 2024
8dde3ba
[Spinal][Kondo]: add limits to servo angle
Li-Jinjie Feb 5, 2024
d39a6da
[Motor Test][script]: print average voltage if supported
Li-Jinjie Feb 5, 2024
4bd089c
[Beetle][config]: update voltages in MotorInfoDShot.yaml -> average m…
Li-Jinjie Feb 5, 2024
6173eef
[Spinal][Battery]: use dshot telemetry to update the battery voltage
Li-Jinjie Feb 5, 2024
ceffd7a
[System Identification] add script to identify inertial parameters
Li-Jinjie Nov 10, 2023
52f3bb5
[System Identification] refactor Sys. Id. script for better use
Li-Jinjie Nov 10, 2023
e12c544
[System Identification] add inertial params identified by experiments.
Li-Jinjie Nov 10, 2023
4fc563d
[System Identification] Update identify_inertial_params.py
Li-Jinjie Nov 11, 2023
2cb3516
[System Identification] fix the compatible problem of print in p2.7, …
Li-Jinjie Nov 13, 2023
74efcc4
[SYSID] create a new folder and refactor code
Li-Jinjie Nov 10, 2023
6e039be
[SYSID] improve the code for SYSID. finish the identification of beet…
Li-Jinjie Feb 6, 2024
489352d
[Beetle][config] update the model parameters in control yaml to SYSID…
Li-Jinjie Feb 6, 2024
86ddf65
[Beetle][Control][NMPC] change printf of acados error to ROS_WARN
Li-Jinjie Feb 12, 2024
07d32f4
[Config][Servo]: config servo conversion for kondo servo
Li-Jinjie Feb 12, 2024
cbcd427
[Spinal][Kondo Servo]: change the communication topics. not successful.
Li-Jinjie Feb 12, 2024
0791859
[Config][Kondo Servo]: fix the bug for servo communication. successful!
Li-Jinjie Feb 13, 2024
5b159de
[SYSID][kondo servo]: refactor the code, identify the real kondo servos
Li-Jinjie Feb 13, 2024
6a8e59d
[Beetle][Control][NMPC]: modify the cost for servo angle change
Li-Jinjie Feb 13, 2024
2177352
[Beetle][Control][NMPC]: use these parameters to achieve first hovering!
Li-Jinjie Feb 13, 2024
416edbc
[Spinal][Kondo]: use timer task to trigger measurement periodically!
Li-Jinjie Feb 14, 2024
a0712e9
[Beetle][Control][NMPC]: update main loop freq from 40hz to 100hz, be…
Li-Jinjie Feb 14, 2024
1cbb455
[Beetle][Control][NMPC]: polish nmpc_solver.cpp
Li-Jinjie Feb 14, 2024
f5edf72
[Beetle][Control][NMPC]: implement dynamic reconfigure! tested in sim…
Li-Jinjie Feb 14, 2024
90f1432
[Beetle][Control][NMPC]: fix a bug in setting weight matrix.
Li-Jinjie Feb 14, 2024
b37bfed
[Beetle][Control][NMPC]: update yaw cost
Li-Jinjie Feb 15, 2024
5c81e4d
[Beetle][Control][NMPC]: change the recovery time of shutting down tr…
Li-Jinjie Feb 15, 2024
d0c5f5d
[SYSID][kondo servo] add support for directly recording kondo servo data
Li-Jinjie Feb 15, 2024
6f6f173
[Beetle][Config]: update t_servo. the previous number is wrong.
Li-Jinjie Feb 15, 2024
043fd85
[SYSID][Kondo Servo]: polish code, make all parameters configurable; …
Li-Jinjie Feb 15, 2024
23e6957
[Beetle][Config]: update the mass to flight with battery. Succeed!
Li-Jinjie Feb 18, 2024
d84e889
[SYSID][Motor Test]: save currency to 0.0 if no power supply is conne…
Li-Jinjie Feb 18, 2024
c1418c8
[SYSID][Motor Test]: add two more figures in analyze_data.py
Li-Jinjie Feb 18, 2024
70e714c
[beetle-art][URDF][Correct]: create multiple .xacro files, update ine…
Li-Jinjie Feb 27, 2024
f481cf2
[beetle-art][RVIZ]: correct a bug in robot model visualization
Li-Jinjie Feb 27, 2024
46ee39a
[beetle-art][Control][Config]: update geometry parameters
Li-Jinjie Feb 27, 2024
c113619
[beetle-art][URDF][Config]: update visual model; update IMU position;…
Li-Jinjie Feb 27, 2024
fa5bd22
[beetle-art][URDF][Config]: update the position of rotor module to ba…
Li-Jinjie Feb 27, 2024
09fa26b
[Beetle]: change the thrust to 1.28*thrust and the takeoff height to …
Li-Jinjie Feb 28, 2024
657069f
[Beetle][Planning]: set a simple Lemniscate traj., succeed!
Li-Jinjie Feb 28, 2024
879a144
[Beetle][planning]: fix a bug in ref traj generation; enlarge the tra…
Li-Jinjie Feb 28, 2024
e171089
[Beetle][NMPC]: change the position of python script
Li-Jinjie Feb 28, 2024
dfe5983
[Control][NMPC]: change the position of all nmpc python script
Li-Jinjie Feb 29, 2024
fa25076
[Control][NMPC]: enable automatically creating directory if there is …
Li-Jinjie Mar 1, 2024
bccb37b
[Control][NMPC]: add a new controller with I term
Li-Jinjie Mar 1, 2024
f4bd236
[Control][NMPC]: add interface for disturb wrench
Li-Jinjie Mar 1, 2024
fad7396
[Control][NMPC]: refactor W to mtx_w to be compatible with ROS C++ st…
Li-Jinjie Mar 1, 2024
3932894
[Control][NMPC]: add I terms to compensate for model error. position …
Li-Jinjie Mar 1, 2024
d879182
[Control][NMPC]: remove redundant code
Li-Jinjie Mar 1, 2024
8138ac0
[Control][NMPC]: read parameters for I term from yaml file
Li-Jinjie Mar 1, 2024
74b933f
[Control][NMPC][viz]: visualize the disturbance wrench
Li-Jinjie Mar 1, 2024
89b1ff6
[Control][NMPC]: make i gain for x, y and roll, pitch independent values
Li-Jinjie Mar 2, 2024
141fdea
[Control][NMPC]: make I gains dynamically configurable
Li-Jinjie Mar 2, 2024
2c178f7
[Control][NMPC]: remove redundant code
Li-Jinjie Mar 2, 2024
ebfc83a
[Control][NMPC]: change behavior after traj. tracking: maintain the a…
Li-Jinjie Mar 2, 2024
cdc9bda
[Control][NMPC]: finish I term for trajectory tracking
Li-Jinjie Mar 2, 2024
c417ac5
[Planning]: shift the phase of Lemniscate Traj. to make the trajector…
Li-Jinjie Mar 2, 2024
c5780ae
[Planning]: update Lemniscate traj. to omnidirectional. The orientati…
Li-Jinjie Mar 3, 2024
13dbbe5
[Planning]: fix a minor bug in the omni traj.; tested in real robot!
Li-Jinjie Mar 4, 2024
18ba0d7
[Python]: update the file creation time
Li-Jinjie Mar 5, 2024
e56d1b6
[Control][NMPC][Py]: refactor the python code, separate the sim code …
Li-Jinjie Mar 9, 2024
43623f1
[Control][NMPC][Py]: polish code
Li-Jinjie Mar 9, 2024
9aea4c6
[Control][NMPC][Py]: extract the template class for nmpc
Li-Jinjie Mar 9, 2024
799cbc3
[Control][NMPC][Py]: extract the template class for XrUrConverter
Li-Jinjie Mar 9, 2024
7202e82
[Control][NMPC][Py]: make ts_ctrl be set in an abstract function; mod…
Li-Jinjie Mar 9, 2024
888f03e
[Control][NMPC][Py]: make nx nu be set from abstractmethod in XrUrCon…
Li-Jinjie Mar 9, 2024
b8a1e1a
[Control][NMPC][Py]: add support to over_act_no_servo_delay model
Li-Jinjie Mar 10, 2024
ff60156
[Control][NMPC][Py]: move pose_point_2_xr_ur() and _get_alloc_mat_pin…
Li-Jinjie Mar 10, 2024
52da40d
[Control][NMPC][Py]: 1. support choose different model for simulation…
Li-Jinjie Mar 10, 2024
14fa468
[Control][NMPC][Py]: Support using different model for control and si…
Li-Jinjie Mar 10, 2024
1d2563a
[Control][NMPC][yaml]: make the parameters for no servo delay the sam…
Li-Jinjie Mar 10, 2024
eaa2a45
[Control][NMPC][Py]: add support for naive cost option
Li-Jinjie Mar 10, 2024
80aa3fd
[Control][NMPC][Py]: fix a naming error
Li-Jinjie Mar 10, 2024
bcf2c27
[Control][NMPC][Py]: support a new type: no_servo_new_cost
Li-Jinjie Mar 10, 2024
7bac7e6
[Control][NMPC][Py]: adapt to the acados version in lab
Li-Jinjie Mar 11, 2024
bd6cce6
[Control][NMPC][Py]: complete the typing
Li-Jinjie Mar 11, 2024
b430b94
[Control][NMPC][Py]: draw the comparison between no_servo and full_ol…
Li-Jinjie Mar 11, 2024
d3094ea
[Control][NMPC][Py]: update weight Rac for NoServoDelay model and Old…
Li-Jinjie Mar 12, 2024
ecf7589
[Control][NMPC][Py]: add plotting type to arguments
Li-Jinjie Mar 12, 2024
60f394e
[Control][NMPC][Py]: update plotting style 1
Li-Jinjie Mar 12, 2024
ae8a308
[Control][NMPC][Py]: update plotting style 1 -> label size
Li-Jinjie Mar 12, 2024
4fc4c0b
[Control][NMPC][Py]: update plotting style 1 -> remove redundant code
Li-Jinjie Mar 12, 2024
77fe638
[Control][NMPC][Py]: add plotting style 2
Li-Jinjie Mar 12, 2024
163d3d0
[Planning]: add a sin wave in Z direction
Li-Jinjie Mar 12, 2024
5cb5dbb
[Planning]: add a sin wave in Yaw direction. However, the system now …
Li-Jinjie Mar 12, 2024
71384d6
[Beetle][Control][NMPC]: to align with paper, change ITerm error from…
Li-Jinjie Mar 12, 2024
703bd08
[Planning]: make the yaw angle traj. smaller to avoid over +pi. Now o…
Li-Jinjie Mar 12, 2024
146d83f
[Beetle][Control][NMPC]: fix the bug: when yaw is over +pi, it will j…
Li-Jinjie Mar 13, 2024
fc06290
[Control][NMPC][Py]: add simulation support for nmpc_over_act_full_i_…
Li-Jinjie Mar 13, 2024
45b306b
[Control][NMPC]: Handle quaternion flip in all nmpc_controllers. Note…
Li-Jinjie Mar 13, 2024
dd3b053
[Planning]: add a new traj. called SetPointTraj()
Li-Jinjie Mar 13, 2024
f09b207
[Planning]: add a script to read csv and plot xyz position. The CSV f…
Li-Jinjie Mar 13, 2024
cf5c0e8
[Planning]: modify the script to read csv and plot xyz attitude. The …
Li-Jinjie Mar 13, 2024
3f34561
[Planning]: the file path and style can be passed into draw_traj.py a…
Li-Jinjie Mar 13, 2024
e9344ab
[Control][NMPC][Py]: capitalize the labels
Li-Jinjie Mar 13, 2024
1f4c3dd
[Control][NMPC][Py]: add a new controller using the derivative of ser…
Li-Jinjie Mar 18, 2024
dfb5f17
[Control][NMPC][Py]: add support for a new controller using the deriv…
Li-Jinjie Mar 19, 2024
e878cd9
[Control][NMPC][Py]: change The integral process from u_cmd[4:] = u_c…
Li-Jinjie Mar 19, 2024
4bab4d2
[Control][NMPC][Py]: add visualization for computation time
Li-Jinjie Mar 19, 2024
31fd875
[Beetle][Control][NMPC]: remove redundant code for body rates. No use…
Li-Jinjie Mar 19, 2024
5209460
[Beetle][Control][NMPC]: refactor the quaternion flip to getOdom()
Li-Jinjie Mar 21, 2024
d7d0512
[Beetle][Control][NMPC]: send command at the beginning of each contro…
Li-Jinjie Mar 21, 2024
1e4468c
[Control][NMPC][Py]: update the layout of taking off
Li-Jinjie Mar 22, 2024
fa00207
[SYSID][Servo][Py]: add a python script for visualization
Li-Jinjie Mar 22, 2024
351b8a2
[SYSID][Servo][Py]: modify the style
Li-Jinjie Mar 22, 2024
5e27ef6
[Control][NMPC][Py]: add a curve for reference
Li-Jinjie Mar 26, 2024
a19f77c
[SYSID][Motor][Py]: add a script to visualise the first-order reaction.
Li-Jinjie Mar 26, 2024
483c450
[SYSID][Servo][MATLAB]: add a function to find the best dead time: 0.…
Li-Jinjie Mar 27, 2024
9744434
[Control][NMPC][Py]: update figure setting
Li-Jinjie Mar 27, 2024
ea5abf2
[Planning][Py]: update the SetPointTraj for better illustration
Li-Jinjie Mar 27, 2024
257f697
[Planning][Py]: update the SetPointTraj. Tested in real world!
Li-Jinjie Mar 27, 2024
b6cdd99
[Planning][Py][viz]: change plotting style
Li-Jinjie Mar 28, 2024
26b06c5
[Planning][Py]: add a function to calculate RMSE
Li-Jinjie Mar 28, 2024
0e12532
[Planning][Py]: update target X and Y in takeoff
Li-Jinjie Mar 29, 2024
a2c44f4
[SYSID][Servo][Py]: change the servo identification files when plotting
Li-Jinjie May 28, 2024
7e16726
[Control][Cfg]: update the weights for i term
Li-Jinjie May 28, 2024
74d05ca
[Control][NMPC][Py]: do refactor
Li-Jinjie May 28, 2024
1221fbe
Merge branch 'refs/heads/develop/MPC_Beetle'
Li-Jinjie May 28, 2024
cf2d61e
[Control][NMPC]: fix a compatibility problem
Li-Jinjie May 28, 2024
37e7a2d
[robot][gimbalrotor]: fix building errors
Li-Jinjie May 28, 2024
5538bcf
Render PlantUML files
github-actions[bot] May 28, 2024
1130370
[robot][beetle]: fix one building error, but still some building errors
Li-Jinjie May 28, 2024
82df2cd
Merge remote-tracking branch 'origin/PR/MPC_Beetle_Merge' into PR/MPC…
Li-Jinjie May 28, 2024
bd17be0
[Control][NMPC][Py]: do refactor, put all files related to tiltable-q…
Li-Jinjie Jun 3, 2024
378e39e
[Motor][Config]: update the motor infor based on the latest identific…
Li-Jinjie Jun 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,8 @@ tags
# mujoco
MUJOCO_LOG.txt
robots/**/mujoco

# acados
*c_generated_code/
*acados_ocp.json
*model.json
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-added-large-files
args: ['--maxkb=10000']

# Python
- repo: https://github.com/psf/black
Expand Down
19 changes: 19 additions & 0 deletions 3rdpary/acados/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
cmake_minimum_required(VERSION 2.8.3)
project(acados)
include(ExternalProject)

#message(WARNING "${CMAKE_INSTALL_PREFIX}")

ExternalProject_Add(
acados
GIT_REPOSITORY https://github.com/acados/acados.git
GIT_TAG fe308a5
CMAKE_ARGS -DACADOS_WITH_QPOASES=ON -DACADOS_INSTALL_DIR=${CMAKE_INSTALL_PREFIX}
INSTALL_COMMAND echo "install"
LOG_DOWNLOAD ON
LOG_CONFIGURE ON
LOG_BUILD ON
LOG_INSTALL_ON
)

install(CODE "execute_process(COMMAND make install WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/acados-prefix/src/acados-build)")
19 changes: 19 additions & 0 deletions 3rdpary/acados/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0"?>
<package>
<name>acados</name>
<version>0.0.0</version>
<description>acados ROS Wrapper</description>
<maintainer email="[email protected]">Moju Zhao</maintainer>

<license>BSD</license>

<buildtool_depend>cmake</buildtool_depend>

<build_depend>git</build_depend>

<export>
<build_type>cmake</build_type>
</export>

</package>

Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ class AerialRobotBase
void mainFunc(const ros::TimerEvent & e);

private:
bool param_verbose_;
double main_rate_;

ros::NodeHandle nh_;
ros::NodeHandle nhp_;
ros::Timer main_timer_;
Expand Down
28 changes: 18 additions & 10 deletions aerial_robot_base/src/aerial_robot_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ AerialRobotBase::AerialRobotBase(ros::NodeHandle nh, ros::NodeHandle nh_private)
navigator_loader_("aerial_robot_control", "aerial_robot_navigation::BaseNavigator")
{

bool param_verbose;
nhp_.param ("param_verbose", param_verbose, true);

double main_rate;
nhp_.param ("main_rate", main_rate, 0.0);
nhp_.param ("param_verbose", param_verbose_, true);
nhp_.param ("main_rate", main_rate_, 0.0);

// robot model
robot_model_ros_ = boost::make_shared<aerial_robot_model::RobotModelRos>(nh_, nhp_);
Expand Down Expand Up @@ -38,29 +35,29 @@ AerialRobotBase::AerialRobotBase(ros::NodeHandle nh, ros::NodeHandle nh_private)
ROS_DEBUG("use default class for flight navigation: aerial_robot_navigation::BaseNavigator");
navigator_ = boost::make_shared<aerial_robot_navigation::BaseNavigator>();
}
navigator_->initialize(nh_, nhp_, robot_model, estimator_, 1 / main_rate);
navigator_->initialize(nh_, nhp_, robot_model, estimator_, 1 / main_rate_);

// controller
try
{
std::string aerial_robot_control_name;
nh_.param ("aerial_robot_control_name", aerial_robot_control_name, std::string("aerial_robot_control/flatness_pid"));
controller_ = controller_loader_.createInstance(aerial_robot_control_name);
controller_->initialize(nh_, nhp_, robot_model, estimator_, navigator_, 1 / main_rate);
controller_->initialize(nh_, nhp_, robot_model, estimator_, navigator_, 1 / main_rate_);
}
catch(pluginlib::PluginlibException& ex)
{
ROS_ERROR("The plugin failed to load for some reason. Error: %s", ex.what());
}

if(param_verbose) cout << nhp_.getNamespace() << ": main_rate is " << main_rate << endl;
if(main_rate <= 0)
if(param_verbose_) cout << nhp_.getNamespace() << ": main_rate is " << main_rate_ << endl;
if(main_rate_ <= 0)
ROS_ERROR_STREAM("mian rate is negative, can not run the main timer");
else
{
// note1: separate the thread for main control (including navigation) loop to guarantee a relatively stable loop rate

ros::TimerOptions ops(ros::Duration(1.0 / main_rate),
ros::TimerOptions ops(ros::Duration(1.0 / main_rate_),
boost::bind(&AerialRobotBase::mainFunc, this, _1),
&main_loop_queue_);
main_timer_ = nhp_.createTimer(ops);
Expand All @@ -87,6 +84,17 @@ AerialRobotBase::~AerialRobotBase()

void AerialRobotBase::mainFunc(const ros::TimerEvent & e)
{
if (!e.last_real.isZero())
{
double dt_real = e.current_real.toSec() - e.last_real.toSec();
double tolerance = 0.05; // 5% tolerance. This value is set based on experience.
double dt_desire = (1.0 + tolerance) * 1.0 / main_rate_;
if (dt_real > dt_desire)
{
ROS_WARN("main loop rate is too low: (ts_real) %f s > (ts_desire with %2f%% tolerance) %f s ", dt_real,
tolerance * 100, dt_desire);
}
}
navigator_->update();
controller_->update();
}
30 changes: 26 additions & 4 deletions aerial_robot_control/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,15 @@ find_package(catkin REQUIRED COMPONENTS

find_package(Eigen3 REQUIRED)


#list(APPEND CMAKE_PREFIX_PATH "~/acados/install/cmake")
find_package(acados) # if we use REQUIED, then will cause OpenBLAS and FortranLib Find_Package error


generate_dynamic_reconfigure_options(
cfg/PID.cfg
cfg/LQI.cfg
cfg/NMPC.cfg
)

### Temporary soulition because of https://github.com/ros/ros_comm/issues/1404
Expand Down Expand Up @@ -51,7 +57,7 @@ include_directories(
### control utils
add_library(control_utils
src/control/utils/care.cpp
)
)
target_link_libraries(control_utils ${EIGEN3_LIBRARIES})

### flight control plugin
Expand All @@ -60,9 +66,25 @@ add_library(flight_control_pluginlib
src/control/fully_actuated_controller.cpp
src/control/under_actuated_controller.cpp
src/control/under_actuated_lqi_controller.cpp
src/control/under_actuated_tilted_lqi_controller.cpp)

target_link_libraries(flight_control_pluginlib ${catkin_LIBRARIES} control_utils)
src/control/under_actuated_tilted_lqi_controller.cpp
src/nmpc/under_act_body_rate/mpc_solver.cpp
src/nmpc/under_act_body_rate/nmpc_controller.cpp
src/nmpc/under_act_full/mpc_solver.cpp
src/nmpc/under_act_full/nmpc_controller.cpp
src/nmpc/over_act_no_servo_delay/nmpc_solver.cpp
src/nmpc/over_act_no_servo_delay/nmpc_controller.cpp
src/nmpc/over_act_full/nmpc_solver.cpp
src/nmpc/over_act_full/nmpc_controller.cpp
src/nmpc/over_act_full_i_term/nmpc_solver.cpp
src/nmpc/over_act_full_i_term/nmpc_controller.cpp
)
target_link_libraries(flight_control_pluginlib ${catkin_LIBRARIES} control_utils acados
${PROJECT_SOURCE_DIR}/include/aerial_robot_control/nmpc/under_act_body_rate/c_generated_code/libacados_ocp_solver_qd_body_rate_model.so
${PROJECT_SOURCE_DIR}/include/aerial_robot_control/nmpc/under_act_full/c_generated_code/libacados_ocp_solver_qd_full_model.so
${PROJECT_SOURCE_DIR}/include/aerial_robot_control/nmpc/over_act_no_servo_delay/c_generated_code/libacados_ocp_solver_beetle_no_servo_delay_model.so
${PROJECT_SOURCE_DIR}/include/aerial_robot_control/nmpc/over_act_full/c_generated_code/libacados_ocp_solver_beetle_full_model.so
${PROJECT_SOURCE_DIR}/include/aerial_robot_control/nmpc/over_act_full_i_term/c_generated_code/libacados_ocp_solver_beetle_full_w_disturb_model.so
)
add_dependencies(flight_control_pluginlib ${PROJECT_NAME}_gencfg)

### flight navigation
Expand Down
30 changes: 30 additions & 0 deletions aerial_robot_control/cfg/NMPC.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env python
PACKAGE = "aerial_robot_control"

from dynamic_reconfigure.parameter_generator_catkin import *
from aerial_robot_msgs.msg import DynamicReconfigureLevels

gen = ParameterGenerator()

gen.add("nmpc_flag", bool_t, DynamicReconfigureLevels.RECONFIGURE_NMPC_FLAG, "NMPC Control Weight Flag", False)
gen.add("Qp_xy", int_t, DynamicReconfigureLevels.RECONFIGURE_NMPC_Q_P_XY, "NMPC Qp_xy", 300, 0, 2000)
gen.add("Qp_z", int_t, DynamicReconfigureLevels.RECONFIGURE_NMPC_Q_P_Z, "NMPC Qp_z", 400, 0, 2000)
gen.add("Qv_xy", int_t, DynamicReconfigureLevels.RECONFIGURE_NMPC_Q_V_XY, "NMPC Qv_xy", 10, 0, 200)
gen.add("Qv_z", int_t, DynamicReconfigureLevels.RECONFIGURE_NMPC_Q_V_Z, "NMPC Qv_z", 10, 0, 200)
gen.add("Qq_xy", int_t, DynamicReconfigureLevels.RECONFIGURE_NMPC_Q_Q_XY, "NMPC Qq_xy", 300, 0, 2000)
gen.add("Qq_z", int_t, DynamicReconfigureLevels.RECONFIGURE_NMPC_Q_Q_Z, "NMPC Qq_z", 500, 0, 2000)
gen.add("Qw_xy", int_t, DynamicReconfigureLevels.RECONFIGURE_NMPC_Q_W_XY, "NMPC Qw_xy", 5, 0, 100)
gen.add("Qw_z", int_t, DynamicReconfigureLevels.RECONFIGURE_NMPC_Q_W_Z, "NMPC Qw_z", 5, 0, 100)
gen.add("Qa", int_t, DynamicReconfigureLevels.RECONFIGURE_NMPC_Q_A, "NMPC Qa", 1, 0, 10)
gen.add("Rt", int_t, DynamicReconfigureLevels.RECONFIGURE_NMPC_R_T, "NMPC Rt", 1, 0, 10)
gen.add("Rac_d", int_t, DynamicReconfigureLevels.RECONFIGURE_NMPC_R_AC_D, "NMPC Rac_d", 250, 0, 2000)

gen.add("i_gain_flag", bool_t, DynamicReconfigureLevels.RECONFIGURE_NMPC_I_GAIN_FLAG, "NMPC I Gain Flag", False)
gen.add("i_gain_x", int_t, DynamicReconfigureLevels.RECONFIGURE_NMPC_I_GAIN_X, "NMPC I Gain x", 3, 0, 20)
gen.add("i_gain_y", int_t, DynamicReconfigureLevels.RECONFIGURE_NMPC_I_GAIN_Y, "NMPC I Gain y", 3, 0, 20)
gen.add("i_gain_z", int_t, DynamicReconfigureLevels.RECONFIGURE_NMPC_I_GAIN_Z, "NMPC I Gain z", 3, 0, 20)
gen.add("i_gain_roll", double_t, DynamicReconfigureLevels.RECONFIGURE_NMPC_I_GAIN_ROLL, "NMPC I Gain roll", 0.5, 0, 3)
gen.add("i_gain_pitch", double_t, DynamicReconfigureLevels.RECONFIGURE_NMPC_I_GAIN_PITCH, "NMPC I Gain pitch", 0.5, 0, 3)
gen.add("i_gain_yaw", double_t, DynamicReconfigureLevels.RECONFIGURE_NMPC_I_GAIN_YAW, "NMPC I Gain yaw", 0.5, 0, 3)

exit(gen.generate(PACKAGE, "aerial_robot_control", "NMPC"))
Original file line number Diff line number Diff line change
Expand Up @@ -572,4 +572,4 @@ namespace aerial_robot_navigation
ROS_INFO_STREAM("[" << nh.getNamespace() << "] " << param_name << ": " << param);
}
};
};
}; // namespace aerial_robot_navigation
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//
// Created by li-jinjie on 23-11-25.
//

#ifndef AERIAL_ROBOT_CONTROL_BASE_MPC_CONTROLLER_H
#define AERIAL_ROBOT_CONTROL_BASE_MPC_CONTROLLER_H

#endif // AERIAL_ROBOT_CONTROL_BASE_MPC_CONTROLLER_H
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//
// Created by li-jinjie on 23-11-25.
//

#ifndef AERIAL_ROBOT_CONTROL_BASE_MPC_SOLVER_H
#define AERIAL_ROBOT_CONTROL_BASE_MPC_SOLVER_H

#endif // AERIAL_ROBOT_CONTROL_BASE_MPC_SOLVER_H
67 changes: 67 additions & 0 deletions aerial_robot_control/include/aerial_robot_control/nmpc/i_term.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
//
// Created by li-jinjie on 24-3-1.
//

#ifndef AERIAL_ROBOT_CONTROL_I_TERM_H
#define AERIAL_ROBOT_CONTROL_I_TERM_H

#endif // AERIAL_ROBOT_CONTROL_I_TERM_H

#pragma once

#include <algorithm>

namespace aerial_robot_control
{
class ITerm
{
public:
ITerm() = default;
~ITerm() = default;

void initialize(double i_gain, double u_limit, double dt)
{
i_gain_ = i_gain;
u_limit_ = u_limit;
dt_ = dt;
i_term_ = 0;
error_last_round_ = 0;
}

void setIGain(double i_gain)
{
i_gain_ = i_gain;
}

double update(double error) // y - y_ref
{
// update the integrator using trapazoidal rule
i_term_ += (dt_ / 2) * (error + error_last_round_);

double u = i_gain_ * i_term_;

double u_sat = std::max(std::min(u, u_limit_), -u_limit_);

// integral anti-windup: adjust integrator to keep u out of saturation
if (i_gain_ != 0)
i_term_ += (dt_ / i_gain_) * (u_sat - u);

error_last_round_ = error;

return u_sat;
}

void reset()
{
i_term_ = 0;
error_last_round_ = 0;
}

private:
double i_gain_;
double u_limit_;
double dt_;
double i_term_;
double error_last_round_;
};
} // namespace aerial_robot_control
Loading
Loading