rm_controllers
Loading...
Searching...
No Matches
protect.h
Go to the documentation of this file.
1//
2// Created by wk on 2026/5/13.
3//
4
5#pragma once
6
7#include <hardware_interface/joint_command_interface.h>
8#include <control_toolbox/pid.h>
9#include <rm_common/filters/filters.h>
10
13
15{
16class Protect : public ModeBase
17{
18public:
19 explicit Protect(BipedalControllerInterface* controller_,
20 const std::vector<hardware_interface::JointHandle*>& joint_handles,
21 const std::vector<control_toolbox::Pid*>& pid_legs,
22 const std::vector<control_toolbox::Pid*>& pid_thetas,
23 const std::vector<control_toolbox::Pid*>& pid_wheels, control_toolbox::Pid* pid_theta_diff,
24 control_toolbox::Pid* pid_yaw_vel);
25 void execute(const ros::Time& time, const ros::Duration& period) override;
26 const char* name() const override
27 {
28 return "PROTECT";
29 }
30
31private:
32 double theta_des_l, theta_des_r, length_des_l, length_des_r;
33 std::vector<hardware_interface::JointHandle*> joint_handles_;
34 std::vector<control_toolbox::Pid*> pid_legs_, pid_thetas_;
35 std::vector<control_toolbox::Pid*> pid_wheels_;
36 control_toolbox::Pid *pid_theta_diff_, *pid_yaw_vel_;
37 std::shared_ptr<RampFilter<double>> ramp_length_des_l_, ramp_length_des_r_, ramp_angle_des_l_, ramp_angle_des_r_;
38};
39} // namespace rm_chassis_controllers
Definition controller_interface.h:13
Definition mode_base.h:20
Definition protect.h:17
Protect(BipedalControllerInterface *controller_, const std::vector< hardware_interface::JointHandle * > &joint_handles, const std::vector< control_toolbox::Pid * > &pid_legs, const std::vector< control_toolbox::Pid * > &pid_thetas, const std::vector< control_toolbox::Pid * > &pid_wheels, control_toolbox::Pid *pid_theta_diff, control_toolbox::Pid *pid_yaw_vel)
Definition protect.cpp:10
void execute(const ros::Time &time, const ros::Duration &period) override
Definition protect.cpp:31
const char * name() const override
Definition protect.h:26
Definition active_suspension.h:16