Skip to content

yinfenglong/gaussian_process

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gaussian_process

simulation and experiments

collect training data for GP

  1. Source enviroument in linux computer.
cd test_ma_ws/
source ros.zsh
cd src/itm
tmuxinator start -p sitl_gazebo.yml
  1. Start MPC controller in simulation.
roslaunch itm_nonlinear_mpc px4_exp_node.launch is_simulation:=true mpc_and_gp:=false
  1. Let the quadrotor take off and record rosbag.
rosbag record -a
rostopic pub /itm_quadrotor_control/user_command itm_mav_msgs/SetMission "header:
  seq: 0
  stamp:
    secs: 0
    nsecs: 0
  frame_id: ''
command_idx: 0
mission_mode: 1"
  1. The quadrotor flies on a trajectory.
itm roslaunch itm_nonlinear_mpc offboard_sim_trajectory_generator_launch.launch horizon:=1 traj_type_idx:=1 
itm rosrun itm_nonlinear_mpc offboard_sim_random_gazebo_trajectory_commander.py 
offboard:
rostopic pub /itm_quadrotor_control/user_command itm_mav_msgs/SetMission "header:
  seq: 0
  stamp:
    secs: 0
    nsecs: 0
  frame_id: ''
command_idx: 0
mission_mode: 3"
  1. Land the quadrotor.
rostopic pub /itm_quadrotor_control/user_command itm_mav_msgs/SetMission "header:
  seq: 0
  stamp:
    secs: 0
    nsecs: 0
  frame_id: ''
command_idx: 0
mission_mode: 2"

GP training

standard process of GP training.

cd ./src/itm/itm_quadrotor_node/itm_nonlinear_mpc/scripts/gaussian_process/gpr/gp_process.yml
tmuxinator start -p gp_process.yml folder_name=q330/20211008_10_with_cargo offset=0.44

training and prediction of different GP models

  1. exact GP (velocity -> acceleration)
python3 gpr_GPyTorch_train.py q330/20211008_10_with_cargo data_for_gp_y.npz
python3 gpr_GPyTorch_predict.py q330/20211008_10_with_cargo data_for_gp_y.npz
  1. exact GP (velocity, altitude -> acceleration)
python3 gpr_GPyTorch_train_2d.py q330/20211008_10_with_cargo data_for_gp_y.npz
python3 gpr_GPyTorch_predict_2d.py q330/20211008_10_with_cargo data_for_gp_y.npz
  1. approximate GP prediction(velocity -> acceleration)
python3 gpr_GPyTorch_dataload_train.py q330/20211008_10_with_cargo data_for_gp_y.npz
python3 gpr_GPyTorch_dataload_predict.py q330/20211008_10_with_cargo data_for_gp_y.npz
  1. approximate GP training(velocity, altitude -> acceleration
python3 gpr_GPyTorch_approximate_train_2d.py q330/20211008_10_with_cargo data_for_gp_y.npz
python3 gpr_GPyTorch_approximate_predict_2d.py q330/20211008_10_with_cargo data_for_gp_y.npz

GP-based MPC

roslaunch itm_nonlinear_mpc px4_exp_node.launch is_simulation:=true mpc_and_gp:=true

mathematical simulation

python3 ./ACADOS_temp_set_p/quad_sim_q.py

manipulator

Turn on the electromagnet.

roslaunch magnet_control magnet.launch pubMagnet:=true 

About

gaussian process (with mpc)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published