Skip to content

Commit

Permalink
[rolling][control] add robot model instance for optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
sugikazu75 committed Dec 23, 2023
1 parent a06d36a commit 98a6df6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions robots/rolling/include/rolling/control/rolling_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ namespace aerial_robot_control
boost::shared_ptr<aerial_robot_navigation::BaseNavigator> navigator,
double ctrl_loop_rate) override;

boost::shared_ptr<aerial_robot_model::RobotModel> getRobotModel() {return robot_model_;}
boost::shared_ptr<RollingRobotModel> getRollingRobotModel() {return rolling_robot_model_;}
boost::shared_ptr<RollingRobotModel> getRollingRobotModelForOpt() {return rolling_robot_model_for_opt_;}

Eigen::VectorXd getTargetWrenchAccCog() {return target_wrench_acc_cog_;}
Eigen::MatrixXd getFullQ() {return full_q_mat_;}
Eigen::MatrixXd getFullQTrans() {return full_q_trans_;}
Expand Down Expand Up @@ -68,6 +72,7 @@ namespace aerial_robot_control

boost::shared_ptr<aerial_robot_navigation::RollingNavigator> rolling_navigator_;
boost::shared_ptr<RollingRobotModel> rolling_robot_model_;
boost::shared_ptr<RollingRobotModel> rolling_robot_model_for_opt_;
boost::shared_ptr<aerial_robot_model::RobotModel> robot_model_for_control_;

std::vector<double> rotor_tilt_;
Expand Down
2 changes: 2 additions & 0 deletions robots/rolling/src/control/rolling_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ void RollingController::initialize(ros::NodeHandle nh, ros::NodeHandle nhp,

rolling_navigator_ = boost::dynamic_pointer_cast<aerial_robot_navigation::RollingNavigator>(navigator_);
rolling_robot_model_ = boost::dynamic_pointer_cast<RollingRobotModel>(robot_model_);
rolling_robot_model_for_opt_ = boost::make_shared<RollingRobotModel>();
robot_model_for_control_ = boost::make_shared<aerial_robot_model::RobotModel>();

rotor_tilt_.resize(motor_num_);
Expand Down Expand Up @@ -105,6 +106,7 @@ void RollingController::rosParamInit()

getParam<double>(nh_, "circle_radius", circle_radius_, 0.5);
rolling_robot_model_->setCircleRadius(circle_radius_);
rolling_robot_model_for_opt_->setCircleRadius(circle_radius_);

getParam<double>(z_nh, "i_gain", default_z_i_gain_, 0.0);

Expand Down

0 comments on commit 98a6df6

Please sign in to comment.