Skip to content

Commit 07a2f2d

Browse files
authored
Utilize walk stabilization (#574)
2 parents 31f5093 + 30a6c9b commit 07a2f2d

File tree

4 files changed

+19
-16
lines changed

4 files changed

+19
-16
lines changed

bitbots_motion/bitbots_quintic_walk/config/robots/jack.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ walking:
44
ros__parameters:
55
engine:
66
trunk_x_offset: 0.0
7+
trunk_y_offset: -0.01
8+
79
node:
810
x_bias: -0.005
911
y_bias: -0.008

bitbots_motion/bitbots_quintic_walk/config/walking_wolfgang_robot.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ walking:
77
foot_apex_phase: 0.5
88
foot_apex_pitch: 0.0
99
foot_distance: 0.2
10-
foot_overshoot_phase: 0.67
11-
foot_overshoot_ratio: 0.1
10+
foot_overshoot_phase: 0.92
11+
foot_overshoot_ratio: 0.0
1212
foot_put_down_phase: 1.0
1313
foot_put_down_z_offset: 0.0
1414
foot_rise: 0.04
@@ -26,7 +26,7 @@ walking:
2626
trunk_pitch_p_coef_forward: 0.0
2727
trunk_pitch_p_coef_turn: 0.0
2828
trunk_swing: 0.25
29-
trunk_x_offset: -0.02
29+
trunk_x_offset: -0.01
3030
trunk_x_offset_p_coef_forward: 0.1
3131
trunk_x_offset_p_coef_turn: 0.0
3232
trunk_y_offset: 0.0
@@ -74,11 +74,11 @@ walking:
7474
trunk_pid:
7575
pitch:
7676
antiwindup: false
77-
d: 0.0
77+
d: 0.004
7878
i: 0.0
7979
i_clamp_max: 0.0
8080
i_clamp_min: 0.0
81-
p: 0.0
81+
p: 0.0035
8282
roll:
8383
antiwindup: false
8484
d: 0.0

bitbots_motion/bitbots_quintic_walk/src/walk_stabilizer.cpp

+9-8
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ void WalkStabilizer::reset() {
1515
pid_trunk_fused_roll_.reset();
1616
}
1717

18-
WalkResponse WalkStabilizer::stabilize(const WalkResponse &response, const rclcpp::Duration &dt) {
18+
WalkResponse WalkStabilizer::stabilize(const WalkResponse& response, const rclcpp::Duration& dt) {
1919
// compute orientation with PID control
2020
double goal_pitch, goal_roll, goal_yaw;
2121
tf2::Matrix3x3(response.support_foot_to_trunk.getRotation()).getRPY(goal_roll, goal_pitch, goal_yaw);
@@ -33,14 +33,15 @@ WalkResponse WalkStabilizer::stabilize(const WalkResponse &response, const rclcp
3333
double fused_pitch_correction =
3434
pid_trunk_fused_pitch_.computeCommand(goal_fused.fusedPitch - response.current_fused_pitch, dt);
3535

36-
tf2::Quaternion corrected_orientation;
37-
goal_fused.fusedRoll += fused_roll_correction;
38-
goal_fused.fusedPitch += fused_pitch_correction;
39-
Eigen::Quaterniond goal_orientation_eigen_corrected = rot_conv::QuatFromFused(goal_fused);
40-
tf2::convert(goal_orientation_eigen_corrected, corrected_orientation);
36+
// Change trunk x offset (in the trunks frame of reference) based on the PID controllers
37+
WalkResponse stabilized_response{response};
4138

42-
WalkResponse stabilized_response = response;
43-
stabilized_response.support_foot_to_trunk.setRotation(corrected_orientation);
39+
tf2::Transform trunk_offset;
40+
trunk_offset.setOrigin(tf2::Vector3(fused_pitch_correction, fused_roll_correction, 0.0));
41+
trunk_offset.setRotation(tf2::Quaternion::getIdentity());
42+
43+
// apply the trunk offset to the trunk pose
44+
stabilized_response.support_foot_to_trunk = trunk_offset * response.support_foot_to_trunk;
4445

4546
return stabilized_response;
4647
}

bitbots_navigation/bitbots_path_planning/config/path_planning_parameters.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -85,19 +85,19 @@ bitbots_path_planning:
8585
bounds<>: [0.0, 1.0]
8686
max_vel_x:
8787
type: double
88-
default_value: 0.07
88+
default_value: 0.12
8989
description: 'Maximum velocity we want to reach in different directions (base_footprint coordinate system)'
9090
validation:
9191
bounds<>: [0.0, 1.0]
9292
min_vel_x:
9393
type: double
94-
default_value: -0.05
94+
default_value: -0.06
9595
description: 'Minimum velocity we want to reach in different directions (base_footprint coordinate system)'
9696
validation:
9797
bounds<>: [-1.0, 0.0]
9898
max_vel_y:
9999
type: double
100-
default_value: 0.06
100+
default_value: 0.07
101101
description: 'Maximum velocity we want to reach in different directions (base_footprint coordinate system)'
102102
validation:
103103
bounds<>: [0.0, 1.0]

0 commit comments

Comments
 (0)