ex_4_conf.py
Go to the documentation of this file.
1 # -*- coding: utf-8 -*-
2 """
3 Created on Thu Apr 18 09:47:07 2019
4 
5 @author: student
6 """
7 
8 import os
9 
10 import numpy as np
11 import pinocchio as pin
12 
13 np.set_printoptions(precision=3, linewidth=200, suppress=True)
14 LINE_WIDTH = 60
15 
16 DATA_FILE_LIPM = "romeo_walking_traj_lipm.npz"
17 DATA_FILE_TSID = "romeo_walking_traj_tsid.npz"
18 
19 # robot parameters
20 # ----------------------------------------------
21 filename = str(os.path.dirname(os.path.abspath(__file__)))
22 path = filename + "/../models/romeo"
23 urdf = path + "/urdf/romeo.urdf"
24 srdf = path + "/srdf/romeo_collision.srdf"
25 nv = 37
26 foot_scaling = 1.0
27 lxp = foot_scaling * 0.10 # foot length in positive x direction
28 lxn = foot_scaling * 0.05 # foot length in negative x direction
29 lyp = foot_scaling * 0.05 # foot length in positive y direction
30 lyn = foot_scaling * 0.05 # foot length in negative y direction
31 lz = 0.07 # foot sole height with respect to ankle joint
32 mu = 0.3 # friction coefficient
33 fMin = 0.0 # minimum normal force
34 fMax = 1e6 # maximum normal force
35 rf_frame_name = "RAnkleRoll" # right foot frame name
36 lf_frame_name = "LAnkleRoll" # left foot frame name
37 contactNormal = np.matrix(
38  [0.0, 0.0, 1.0]
39 ).T # direction of the normal to the contact surface
40 
41 # configuration for LIPM trajectory optimization
42 # ----------------------------------------------
43 alpha = 10 ** (2) # CoP error squared cost weight
44 beta = 0 # CoM position error squared cost weight
45 gamma = 10 ** (-1) # CoM velocity error squared cost weight
46 h = 0.58 # fixed CoM height
47 g = 9.81 # norm of the gravity vector
48 foot_step_0 = np.array([0.0, -0.096]) # initial foot step position in x-y
49 dt_mpc = 0.1 # sampling time interval
50 T_step = 1.2 # time needed for every step
51 step_length = 0.05 # fixed step length
52 step_height = 0.05 # fixed step height
53 nb_steps = 4 # number of desired walking steps
54 
55 # configuration for TSID
56 # ----------------------------------------------
57 dt = 0.002 # controller time step
58 T_pre = 1.5 # simulation time before starting to walk
59 T_post = 1.5 # simulation time after walking
60 
61 w_com = 1.0 # weight of center of mass task
62 w_cop = 0.0 # weight of center of pressure task
63 w_am = 1e-4 # weight of angular momentum task
64 w_foot = 1e0 # weight of the foot motion task
65 w_contact = 1e2 # weight of the foot in contact
66 w_posture = 1e-4 # weight of joint posture task
67 w_forceRef = 1e-5 # weight of force regularization task
68 w_torque_bounds = 0.0 # weight of the torque bounds
69 w_joint_bounds = 0.0
70 
71 tau_max_scaling = 1.45 # scaling factor of torque bounds
72 v_max_scaling = 0.8
73 
74 kp_contact = 10.0 # proportional gain of contact constraint
75 kp_foot = 10.0 # proportional gain of contact constraint
76 kp_com = 10.0 # proportional gain of center of mass task
77 kp_am = 10.0 # proportional gain of angular momentum task
78 kp_posture = 1.0 # proportional gain of joint posture task
79 gain_vector = kp_posture * np.ones(nv - 6)
80 masks_posture = np.ones(nv - 6)
81 
82 # configuration for viewer
83 # ----------------------------------------------
84 viewer = pin.visualize.GepettoVisualizer
85 PRINT_N = 500 # print every PRINT_N time steps
86 DISPLAY_N = 20 # update robot configuration in viwewer every DISPLAY_N time steps
87 CAMERA_TRANSFORM = [
88  3.578777551651001,
89  1.2937744855880737,
90  0.8885031342506409,
91  0.4116811454296112,
92  0.5468055009841919,
93  0.6109083890914917,
94  0.3978860676288605,
95 ]


tsid
Author(s): Andrea Del Prete, Justin Carpentier
autogenerated on Sun Jul 2 2023 02:21:51