50 Eigen::Matrix<double, 3, 1> base_to_hip_distance;
53 + sqrt(base_to_hip_distance(0)*base_to_hip_distance(0) + base_to_hip_distance(1)*base_to_hip_distance(1));
71 case MotionState::kStancePreSwingFlRr:
77 case MotionState::kSwingFlRr:
83 case MotionState::kStancePreSwingFrRl:
89 case MotionState::kSwingFrRl:
113 case MotionState::kStancePreSwingFlRr:
123 case MotionState::kSwingFlRr:
133 case MotionState::kStancePreSwingFrRl:
142 case MotionState::kSwingFrRl:
162 case MotionState::kStancePreSwingFlRr:
175 case MotionState::kSwingFlRr:
188 case MotionState::kStancePreSwingFrRl:
200 case MotionState::kSwingFrRl:
221 Eigen::Matrix<double, 3, 1> foot_pos;
231 case Kinematics::LegType::frontLeft:
248 case Kinematics::LegType::frontRight:
265 case Kinematics::LegType::rearLeft:
282 case Kinematics::LegType::rearRight:
300 ROS_WARN(
"RobotController::UpdateStanceFootPosition - Invalid leg type selected");
309 Eigen::Matrix<double, 3, 1> foot_pos;
317 case Kinematics::LegType::frontLeft:
326 case Kinematics::LegType::frontRight:
334 case Kinematics::LegType::rearLeft:
342 case Kinematics::LegType::rearRight:
352 ROS_WARN(
"RobotController::UpdateSwingFootPosition - Invalid leg type selected");
363 double center_percentage = progress - 0.5;
365 Eigen::Matrix<double, 3, 1> foot_default;
366 Eigen::Matrix<double, 3, 1> foot_pos;
367 Eigen::Matrix<double, 3, 1> foot_vel;
368 Eigen::Matrix<double, 3, 1> foot_acc;
369 Eigen::Matrix<double, 3, 1> foot_jerk;
375 case Kinematics::LegType::frontLeft:
402 case Kinematics::LegType::frontRight:
424 case Kinematics::LegType::rearLeft:
446 case Kinematics::LegType::rearRight:
469 ROS_WARN(
"RobotController::UpdateSwingFootTrajectory - Invalid leg type selected");
489 ROS_INFO(
"State: %d\tIteration: %d\tVlx: %f\tVly: %f\tVax: %f\tVay: %f\tFeet: %f\t%f\t%f\t%f\t%f\t%f\t%f\t%f\t%f\t%f\t%f\t%f\t",
Eigen::Vector3d fr_offset
Eigen::Vector3d fl_acceleration_body
double _lin_vel_x_estimated
double _lin_vel_y_estimated
Eigen::Vector3d fl_offset
double lin_vel_y
The desired linear robot velocity in the body frame's y direction.
Eigen::Vector3d fl_velocity_body
Eigen::Vector3d rr_offset
Eigen::Vector3d rl_position_body
Eigen::Vector3d rl_acceleration_body
Eigen::Matrix< double, 6, 1 > base_pose_commands
Eigen::Vector3d fl_position_body
double _ang_vel_z_estimated
Eigen::Vector3d rr_position_body
double ang_vel_z
The desired angular robot velocity around the robot's z axis.
Eigen::Vector3d fr_acceleration_body
Eigen::Vector3d fr_position_body
double lin_vel_x
The desired linear robot velocity in the body frame's x direction.
Eigen::Vector3d rr_velocity_body
Eigen::Vector3d rl_offset
Eigen::Vector3d rr_acceleration_body
Eigen::Vector3d rl_velocity_body
Eigen::Vector3d fr_velocity_body
LegType
Leg type enumerator.
double step_distance_x_linear
double step_distance_y_linear
double swing_rise_percentage
void UpdateFeetReferences()
A function updating the foot positions of the robot in the hip frames.
double _guidance_lin_vel_gain
MotionState motion_state
A variable deciding which of the four motion states we are currently in.
void UpdateFeetTrajectories()
double _lin_vel_x_command
void UpdateNonGuidanceCommands()
double stance_phase_duration_percentage
Eigen::Matrix< double, 3, 1 > UpdateSwingFootPosition(Kinematics::LegType _leg_type, double _progress)
Eigen::Matrix< double, 3, 1 > UpdateStanceFootPosition(Kinematics::LegType _leg_type, double _progress)
double _ang_vel_z_command
double _guidance_ang_vel_gain
void UpdateGuidanceCommands()
void PrintFootPositions()
double step_distance_x_rotational
void UpdateStepDistances()
double step_distance_y_rotational
RobotController(int controller_freq, double gait_period)
void UpdateSwingFootTrajectory(Kinematics::LegType _leg_type, double progress)
double _lin_vel_y_command
#define LEG_OFFSET_LENGTH
void CalculateFourthOrderPolynomialTrajectory(double t, double swing_period, double distance, double &_pos, double &_vel, double _acc)
void CalculatePolynomialTrajectory(double t, double swing_period, double rise_percentage, double distance, double vel_cmd, double &_pos, double &_vel, double &_acc, double &_jerk)