1212 compute_swing_foot_pose ,
1313 compute_time_vector ,
1414 BezierCurveFootPathGenerator ,
15+ compute_onplace_steps_sequence ,
1516)
1617
1718from biped_walking_controller .inverse_kinematic import InvKinSolverParams , solve_inverse_kinematics
2324 update_control ,
2425 compute_zmp_ref ,
2526 cubic_spline_interpolation ,
27+ linear_interpolation ,
2628)
2729
2830from biped_walking_controller .model import Talos , q_from_base_and_joints
@@ -49,19 +51,19 @@ def main():
4951
5052 np .set_printoptions (suppress = True , precision = 3 )
5153
52- dt = 1.0 / 240 .0
54+ dt = 1.0 / 1000 .0
5355
5456 # ZMP reference parameters
5557 t_ss = 0.8 # Single support phase time window
5658 t_ds = 0.3 # Double support phase time window
57- t_init = 2 .0 # Initialization phase (transition from still position to first step)
59+ t_init = 5 .0 # Initialization phase (transition from still position to first step)
5860 t_end = 2.0
59- n_steps = 5 # Number of steps executed by the robot
61+ n_steps = 3 # Number of steps executed by the robot
6062 l_stride = 0.1 # Length of the stride
61- max_height_foot = 0.03 # Maximal height of the swing foot
63+ max_height_foot = 0.005 # Maximal height of the swing foot
6264
6365 # Preview controller parameters
64- t_preview = 1.6 # Time horizon used for the preview controller
66+ t_preview = 4.0 # Time horizon used for the preview controller
6567 ctrler_params = PreviewControllerParams (
6668 zc = 0.89 ,
6769 g = 9.81 ,
@@ -82,7 +84,7 @@ def main():
8284 path_to_robot_urdf = args .path_talos_data .expanduser ()
8385 / "talos_data"
8486 / "urdf"
85- / "talos_full .urdf" ,
87+ / "talos_full_v2 .urdf" ,
8688 model = talos ,
8789 launch_gui = args .launch_gui ,
8890 )
@@ -172,8 +174,9 @@ def main():
172174 simulator .reset_robot_configuration (q_des )
173175 simulator .step ()
174176
175- lf_initial_pose = oMf_lf_tgt .translation
176- rf_initial_pose = oMf_rf_tgt .translation
177+ foot_offset = np .array ([0.0 , 0.0 , 0.002 ])
178+ lf_initial_pose = oMf_lf_tgt .translation + foot_offset
179+ rf_initial_pose = oMf_rf_tgt .translation + foot_offset
177180
178181 # Build ZMP reference to track
179182 steps_pose , steps_ids = compute_steps_sequence (
@@ -252,6 +255,13 @@ def main():
252255 states [k ] = state_machine .get_current_state ().value
253256
254257 zmp_pos [k ] = simulator .get_zmp_pose ()
258+ # zmp_pos[k] = np.array(
259+ # [
260+ # x_k[1] - ctrler_params.zc / ctrler_params.g * x_k[3],
261+ # y_k[1] - ctrler_params.zc / ctrler_params.g * y_k[3],
262+ # 0.0,
263+ # ]
264+ # )
255265
256266 step_idx = state_machine .get_step_idx ()
257267
@@ -268,6 +278,7 @@ def main():
268278 lf_target = steps_pose [step_idx + 1 ]
269279
270280 rf_pose = steps_pose [step_idx ]
281+ # lf_pose = lf_start
271282 lf_pose = compute_swing_foot_pose (
272283 t_state = state_machine .get_elapsed_time_in_state (k * dt ),
273284 params = params ,
@@ -298,6 +309,7 @@ def main():
298309 ik_sol_params .moving_foot_frame = talos .right_foot_id
299310
300311 lf_pose = steps_pose [step_idx ]
312+ # rf_pose = rf_start
301313 rf_pose = compute_swing_foot_pose (
302314 t_state = state_machine .get_elapsed_time_in_state (k * dt ),
303315 params = params ,
@@ -306,7 +318,6 @@ def main():
306318 touchdown_extension_vel = touchdown_vel ,
307319 path_generator = foot_path_generator ,
308320 )
309-
310321 oMf_rf = pin .SE3 (oMf_rf_tgt .rotation , rf_pose )
311322 q_des , dq = solve_inverse_kinematics (
312323 q_init ,
0 commit comments