Compare commits

...

2 Commits
main ... task-3

9 changed files with 5332 additions and 1446 deletions

1297
task_3/Gait_Def_down.toml Normal file

File diff suppressed because it is too large Load Diff

138
task_3/Gait_Def_moonwalk.toml Executable file
View File

@ -0,0 +1,138 @@
# Gait Def for moonwalk
# 1
[[section]]
contact = [1, 1, 1, 1]
duration = 8
[[section]]
contact = [0, 0, 0, 0]
duration = 2
[[section]]
contact = [0, 1, 1, 0]
duration = 6
[[section]]
contact = [0, 0, 0, 0]
duration = 2
[[section]]
contact = [1, 1, 1, 1]
duration = 8
[[section]]
contact = [0, 0, 0, 0]
duration = 2
[[section]]
contact = [1, 0, 0, 1]
duration = 6
[[section]]
contact = [0, 0, 0, 0]
duration = 2
# 2
[[section]]
contact = [1, 1, 1, 1]
duration = 8
[[section]]
contact = [0, 0, 0, 0]
duration = 2
[[section]]
contact = [0, 1, 1, 0]
duration = 6
[[section]]
contact = [0, 0, 0, 0]
duration = 2
[[section]]
contact = [1, 1, 1, 1]
duration = 8
[[section]]
contact = [0, 0, 0, 0]
duration = 2
[[section]]
contact = [1, 0, 0, 1]
duration = 6
[[section]]
contact = [0, 0, 0, 0]
duration = 2
# 3
[[section]]
contact = [1, 1, 1, 1]
duration = 8
[[section]]
contact = [0, 0, 0, 0]
duration = 2
[[section]]
contact = [0, 1, 1, 0]
duration = 6
[[section]]
contact = [0, 0, 0, 0]
duration = 2
[[section]]
contact = [1, 1, 1, 1]
duration = 8
[[section]]
contact = [0, 0, 0, 0]
duration = 2
[[section]]
contact = [1, 0, 0, 1]
duration = 6
[[section]]
contact = [0, 0, 0, 0]
duration = 2
# 4
[[section]]
contact = [1, 1, 1, 1]
duration = 8
[[section]]
contact = [0, 0, 0, 0]
duration = 2
[[section]]
contact = [0, 1, 1, 0]
duration = 6
[[section]]
contact = [0, 0, 0, 0]
duration = 2
[[section]]
contact = [1, 1, 1, 1]
duration = 8
[[section]]
contact = [0, 0, 0, 0]
duration = 2
[[section]]
contact = [1, 0, 0, 1]
duration = 6
[[section]]
contact = [0, 0, 0, 0]
duration = 2
# 5
[[section]]
contact = [1, 1, 1, 1]
duration = 8

View File

@ -8735,4 +8735,4 @@ mu = 0.5
step_height = [0.0, 0.0, 0.0, 0.10]
type = "usergait"
use_mpc_traj = 1
weight = [20.0, 25.0, 30.0, 10.0, 10.0, 50.0]
weight = [20.0, 25.0, 30.0, 10.0, 10.0, 50.0]

215
task_3/Gait_Params_moonwalk.toml Executable file
View File

@ -0,0 +1,215 @@
# Gait Params for moonwalk
# 1
[[step]]
type = "usergait"
body_vel_des = [0.0, 0.0, 0.0]
body_pos_des = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
landing_pos_des = [0.065, 0.00, 0.0, 0.00, -0.00, 0.0, 0.00, 0.00, 0.0, 0.065, 0.00, 0.0]
step_height = [0.05, 0.01, 0.01, 0.05]
weight = [10.0, 10.0, 10.0, 50.0, 50.0, 10.0]
use_mpc_traj = 0
mu = 0.40
landing_gain = 1.0
gait_id = 110
duration = 300
[[step]]
type = "usergait"
body_vel_des = [0.0, 0.0, 0.0]
body_pos_des = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
landing_pos_des = [0.065, 0.00, 0.0, -0.065, -0.00, 0.0, -0.065, 0.00, 0.0, 0.065, 0.00, 0.0]
step_height = [0.05, 0.01, 0.01, 0.05]
weight = [10.0, 10.0, 10.0, 50.0, 50.0, 10.0]
use_mpc_traj = 0
mu = 0.40
landing_gain = 1.0
gait_id = 110
duration = 240
[[step]]
type = "usergait"
body_vel_des = [0.0, 0.0, 0.0]
body_pos_des = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
landing_pos_des = [0.00, 0.00, 0.0, 0.065, -0.00, 0.0, 0.065, 0.00, 0.0, 0.00, 0.00, 0.0]
step_height = [0.01, 0.05, 0.05, 0.01]
weight = [10.0, 10.0, 10.0, 50.0, 50.0, 10.0]
use_mpc_traj = 0
mu = 0.40
landing_gain = 1.0
gait_id = 110
duration = 300
[[step]]
type = "usergait"
body_vel_des = [0.0, 0.0, 0.0]
body_pos_des = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
landing_pos_des = [-0.065, 0.00, 0.0, 0.065, -0.00, 0.0, 0.065, 0.00, 0.0, -0.065, 0.00, 0.0]
step_height = [0.01, 0.05, 0.05, 0.01]
weight = [10.0, 10.0, 10.0, 50.0, 50.0, 10.0]
use_mpc_traj = 0
mu = 0.40
landing_gain = 1.0
gait_id = 110
duration = 240
# 2
[[step]]
type = "usergait"
body_vel_des = [0.0, 0.0, 0.0]
body_pos_des = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
landing_pos_des = [0.065, 0.00, 0.0, 0.00, -0.00, 0.0, 0.00, 0.00, 0.0, 0.065, 0.00, 0.0]
step_height = [0.05, 0.01, 0.01, 0.05]
weight = [10.0, 10.0, 10.0, 50.0, 50.0, 10.0]
use_mpc_traj = 0
mu = 0.40
landing_gain = 1.0
gait_id = 110
duration = 300
[[step]]
type = "usergait"
body_vel_des = [0.0, 0.0, 0.0]
body_pos_des = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
landing_pos_des = [0.065, 0.00, 0.0, -0.065, -0.00, 0.0, -0.065, 0.00, 0.0, 0.065, 0.00, 0.0]
step_height = [0.05, 0.01, 0.01, 0.05]
weight = [10.0, 10.0, 10.0, 50.0, 50.0, 10.0]
use_mpc_traj = 0
mu = 0.40
landing_gain = 1.0
gait_id = 110
duration = 240
[[step]]
type = "usergait"
body_vel_des = [0.0, 0.0, 0.0]
body_pos_des = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
landing_pos_des = [0.00, 0.00, 0.0, 0.065, -0.00, 0.0, 0.065, 0.00, 0.0, 0.00, 0.00, 0.0]
step_height = [0.01, 0.05, 0.05, 0.01]
weight = [10.0, 10.0, 10.0, 50.0, 50.0, 10.0]
use_mpc_traj = 0
mu = 0.40
landing_gain = 1.0
gait_id = 110
duration = 300
[[step]]
type = "usergait"
body_vel_des = [0.0, 0.0, 0.0]
body_pos_des = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
landing_pos_des = [-0.065, 0.00, 0.0, 0.065, -0.00, 0.0, 0.065, 0.00, 0.0, -0.065, 0.00, 0.0]
step_height = [0.01, 0.05, 0.05, 0.01]
weight = [10.0, 10.0, 10.0, 50.0, 50.0, 10.0]
use_mpc_traj = 0
mu = 0.40
landing_gain = 1.0
gait_id = 110
duration = 240
# 3
[[step]]
type = "usergait"
body_vel_des = [0.0, 0.0, 0.0]
body_pos_des = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
landing_pos_des = [0.065, 0.00, 0.0, 0.00, -0.00, 0.0, 0.00, 0.00, 0.0, 0.065, 0.00, 0.0]
step_height = [0.05, 0.01, 0.01, 0.05]
weight = [10.0, 10.0, 10.0, 50.0, 50.0, 10.0]
use_mpc_traj = 0
mu = 0.40
landing_gain = 1.0
gait_id = 110
duration = 300
[[step]]
type = "usergait"
body_vel_des = [0.0, 0.0, 0.0]
body_pos_des = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
landing_pos_des = [0.065, 0.00, 0.0, -0.065, -0.00, 0.0, -0.065, 0.00, 0.0, 0.065, 0.00, 0.0]
step_height = [0.05, 0.01, 0.01, 0.05]
weight = [10.0, 10.0, 10.0, 50.0, 50.0, 10.0]
use_mpc_traj = 0
mu = 0.40
landing_gain = 1.0
gait_id = 110
duration = 240
[[step]]
type = "usergait"
body_vel_des = [0.0, 0.0, 0.0]
body_pos_des = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
landing_pos_des = [0.00, 0.00, 0.0, 0.065, -0.00, 0.0, 0.065, 0.00, 0.0, 0.00, 0.00, 0.0]
step_height = [0.01, 0.05, 0.05, 0.01]
weight = [10.0, 10.0, 10.0, 50.0, 50.0, 10.0]
use_mpc_traj = 0
mu = 0.40
landing_gain = 1.0
gait_id = 110
duration = 300
[[step]]
type = "usergait"
body_vel_des = [0.0, 0.0, 0.0]
body_pos_des = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
landing_pos_des = [-0.065, 0.00, 0.0, 0.065, -0.00, 0.0, 0.065, 0.00, 0.0, -0.065, 0.00, 0.0]
step_height = [0.01, 0.05, 0.05, 0.01]
weight = [10.0, 10.0, 10.0, 50.0, 50.0, 10.0]
use_mpc_traj = 0
mu = 0.40
landing_gain = 1.0
gait_id = 110
duration = 240
# 4
[[step]]
type = "usergait"
body_vel_des = [0.0, 0.0, 0.0]
body_pos_des = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
landing_pos_des = [0.065, 0.00, 0.0, 0.00, -0.00, 0.0, 0.00, 0.00, 0.0, 0.065, 0.00, 0.0]
step_height = [0.05, 0.01, 0.01, 0.05]
weight = [10.0, 10.0, 10.0, 50.0, 50.0, 10.0]
use_mpc_traj = 0
mu = 0.40
landing_gain = 1.0
gait_id = 110
duration = 300
[[step]]
type = "usergait"
body_vel_des = [0.0, 0.0, 0.0]
body_pos_des = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
landing_pos_des = [0.065, 0.00, 0.0, -0.065, -0.00, 0.0, -0.065, 0.00, 0.0, 0.065, 0.00, 0.0]
step_height = [0.05, 0.01, 0.01, 0.05]
weight = [10.0, 10.0, 10.0, 50.0, 50.0, 10.0]
use_mpc_traj = 0
mu = 0.40
landing_gain = 1.0
gait_id = 110
duration = 240
[[step]]
type = "usergait"
body_vel_des = [0.0, 0.0, 0.0]
body_pos_des = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
landing_pos_des = [0.00, 0.00, 0.0, 0.00, -0.00, 0.0, 0.00, 0.00, 0.0, 0.00, 0.00, 0.0]
step_height = [0.01, 0.05, 0.05, 0.01]
weight = [10.0, 10.0, 10.0, 50.0, 50.0, 10.0]
use_mpc_traj = 0
mu = 0.40
landing_gain = 1.0
gait_id = 110
duration = 300
[[step]]
type = "usergait"
body_vel_des = [0.0, 0.0, 0.0]
body_pos_des = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
landing_pos_des = [-0.00, 0.00, 0.0, 0.00, -0.00, 0.0, 0.00, 0.00, 0.0, -0.00, 0.00, 0.0]
step_height = [0.01, 0.05, 0.05, 0.01]
weight = [10.0, 10.0, 10.0, 50.0, 50.0, 10.0]
use_mpc_traj = 0
mu = 0.40
landing_gain = 1.0
gait_id = 110
duration = 240
# End of moonwalk #

View File

@ -0,0 +1,241 @@
# Gait Params
[[step]]
mode = 11
gait_id = 110
contact = 10
life_count = 0
vel_des = [ 0.0, 0.0, 0.0,]
rpy_des = [ 0.0, 0.0, 0.0,]
pos_des = [ 0.0, 0.0, 0.0,]
acc_des = [ 10.0, 10.0, 10.0, 50.0, 50.0, 10.0,]
ctrl_point = [ 0.065, 0.0, 0.4,]
foot_pose = [ 0.065, 0.0, 0.0, 0.0, 0.0, 0.0,]
step_height = [ 10050.0, 50010.0,]
value = 0
duration = 300
[[step]]
mode = 11
gait_id = 110
contact = 10
life_count = 0
vel_des = [ 0.0, 0.0, 0.0,]
rpy_des = [ 0.0, 0.0, 0.0,]
pos_des = [ 0.0, 0.0, 0.0,]
acc_des = [ 10.0, 10.0, 10.0, 50.0, 50.0, 10.0,]
ctrl_point = [ 0.065, 0.0, 0.4,]
foot_pose = [ 0.065, 0.0, -0.065, 0.0, -0.065, 0.0,]
step_height = [ 10050.0, 50010.0,]
value = 0
duration = 240
[[step]]
mode = 11
gait_id = 110
contact = 10
life_count = 0
vel_des = [ 0.0, 0.0, 0.0,]
rpy_des = [ 0.0, 0.0, 0.0,]
pos_des = [ 0.0, 0.0, 0.0,]
acc_des = [ 10.0, 10.0, 10.0, 50.0, 50.0, 10.0,]
ctrl_point = [ 0.0, 0.0, 0.4,]
foot_pose = [ 0.0, 0.0, 0.065, 0.0, 0.065, 0.0,]
step_height = [ 50010.0, 10050.0,]
value = 0
duration = 300
[[step]]
mode = 11
gait_id = 110
contact = 10
life_count = 0
vel_des = [ 0.0, 0.0, 0.0,]
rpy_des = [ 0.0, 0.0, 0.0,]
pos_des = [ 0.0, 0.0, 0.0,]
acc_des = [ 10.0, 10.0, 10.0, 50.0, 50.0, 10.0,]
ctrl_point = [ -0.065, 0.0, 0.4,]
foot_pose = [ -0.065, 0.0, 0.065, 0.0, 0.065, 0.0,]
step_height = [ 50010.0, 10050.0,]
value = 0
duration = 240
[[step]]
mode = 11
gait_id = 110
contact = 10
life_count = 0
vel_des = [ 0.0, 0.0, 0.0,]
rpy_des = [ 0.0, 0.0, 0.0,]
pos_des = [ 0.0, 0.0, 0.0,]
acc_des = [ 10.0, 10.0, 10.0, 50.0, 50.0, 10.0,]
ctrl_point = [ 0.065, 0.0, 0.4,]
foot_pose = [ 0.065, 0.0, 0.0, 0.0, 0.0, 0.0,]
step_height = [ 10050.0, 50010.0,]
value = 0
duration = 300
[[step]]
mode = 11
gait_id = 110
contact = 10
life_count = 0
vel_des = [ 0.0, 0.0, 0.0,]
rpy_des = [ 0.0, 0.0, 0.0,]
pos_des = [ 0.0, 0.0, 0.0,]
acc_des = [ 10.0, 10.0, 10.0, 50.0, 50.0, 10.0,]
ctrl_point = [ 0.065, 0.0, 0.4,]
foot_pose = [ 0.065, 0.0, -0.065, 0.0, -0.065, 0.0,]
step_height = [ 10050.0, 50010.0,]
value = 0
duration = 240
[[step]]
mode = 11
gait_id = 110
contact = 10
life_count = 0
vel_des = [ 0.0, 0.0, 0.0,]
rpy_des = [ 0.0, 0.0, 0.0,]
pos_des = [ 0.0, 0.0, 0.0,]
acc_des = [ 10.0, 10.0, 10.0, 50.0, 50.0, 10.0,]
ctrl_point = [ 0.0, 0.0, 0.4,]
foot_pose = [ 0.0, 0.0, 0.065, 0.0, 0.065, 0.0,]
step_height = [ 50010.0, 10050.0,]
value = 0
duration = 300
[[step]]
mode = 11
gait_id = 110
contact = 10
life_count = 0
vel_des = [ 0.0, 0.0, 0.0,]
rpy_des = [ 0.0, 0.0, 0.0,]
pos_des = [ 0.0, 0.0, 0.0,]
acc_des = [ 10.0, 10.0, 10.0, 50.0, 50.0, 10.0,]
ctrl_point = [ -0.065, 0.0, 0.4,]
foot_pose = [ -0.065, 0.0, 0.065, 0.0, 0.065, 0.0,]
step_height = [ 50010.0, 10050.0,]
value = 0
duration = 240
[[step]]
mode = 11
gait_id = 110
contact = 10
life_count = 0
vel_des = [ 0.0, 0.0, 0.0,]
rpy_des = [ 0.0, 0.0, 0.0,]
pos_des = [ 0.0, 0.0, 0.0,]
acc_des = [ 10.0, 10.0, 10.0, 50.0, 50.0, 10.0,]
ctrl_point = [ 0.065, 0.0, 0.4,]
foot_pose = [ 0.065, 0.0, 0.0, 0.0, 0.0, 0.0,]
step_height = [ 10050.0, 50010.0,]
value = 0
duration = 300
[[step]]
mode = 11
gait_id = 110
contact = 10
life_count = 0
vel_des = [ 0.0, 0.0, 0.0,]
rpy_des = [ 0.0, 0.0, 0.0,]
pos_des = [ 0.0, 0.0, 0.0,]
acc_des = [ 10.0, 10.0, 10.0, 50.0, 50.0, 10.0,]
ctrl_point = [ 0.065, 0.0, 0.4,]
foot_pose = [ 0.065, 0.0, -0.065, 0.0, -0.065, 0.0,]
step_height = [ 10050.0, 50010.0,]
value = 0
duration = 240
[[step]]
mode = 11
gait_id = 110
contact = 10
life_count = 0
vel_des = [ 0.0, 0.0, 0.0,]
rpy_des = [ 0.0, 0.0, 0.0,]
pos_des = [ 0.0, 0.0, 0.0,]
acc_des = [ 10.0, 10.0, 10.0, 50.0, 50.0, 10.0,]
ctrl_point = [ 0.0, 0.0, 0.4,]
foot_pose = [ 0.0, 0.0, 0.065, 0.0, 0.065, 0.0,]
step_height = [ 50010.0, 10050.0,]
value = 0
duration = 300
[[step]]
mode = 11
gait_id = 110
contact = 10
life_count = 0
vel_des = [ 0.0, 0.0, 0.0,]
rpy_des = [ 0.0, 0.0, 0.0,]
pos_des = [ 0.0, 0.0, 0.0,]
acc_des = [ 10.0, 10.0, 10.0, 50.0, 50.0, 10.0,]
ctrl_point = [ -0.065, 0.0, 0.4,]
foot_pose = [ -0.065, 0.0, 0.065, 0.0, 0.065, 0.0,]
step_height = [ 50010.0, 10050.0,]
value = 0
duration = 240
[[step]]
mode = 11
gait_id = 110
contact = 10
life_count = 0
vel_des = [ 0.0, 0.0, 0.0,]
rpy_des = [ 0.0, 0.0, 0.0,]
pos_des = [ 0.0, 0.0, 0.0,]
acc_des = [ 10.0, 10.0, 10.0, 50.0, 50.0, 10.0,]
ctrl_point = [ 0.065, 0.0, 0.4,]
foot_pose = [ 0.065, 0.0, 0.0, 0.0, 0.0, 0.0,]
step_height = [ 10050.0, 50010.0,]
value = 0
duration = 300
[[step]]
mode = 11
gait_id = 110
contact = 10
life_count = 0
vel_des = [ 0.0, 0.0, 0.0,]
rpy_des = [ 0.0, 0.0, 0.0,]
pos_des = [ 0.0, 0.0, 0.0,]
acc_des = [ 10.0, 10.0, 10.0, 50.0, 50.0, 10.0,]
ctrl_point = [ 0.065, 0.0, 0.4,]
foot_pose = [ 0.065, 0.0, -0.065, 0.0, -0.065, 0.0,]
step_height = [ 10050.0, 50010.0,]
value = 0
duration = 240
[[step]]
mode = 11
gait_id = 110
contact = 10
life_count = 0
vel_des = [ 0.0, 0.0, 0.0,]
rpy_des = [ 0.0, 0.0, 0.0,]
pos_des = [ 0.0, 0.0, 0.0,]
acc_des = [ 10.0, 10.0, 10.0, 50.0, 50.0, 10.0,]
ctrl_point = [ 0.0, 0.0, 0.4,]
foot_pose = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,]
step_height = [ 50010.0, 10050.0,]
value = 0
duration = 300
[[step]]
mode = 11
gait_id = 110
contact = 10
life_count = 0
vel_des = [ 0.0, 0.0, 0.0,]
rpy_des = [ 0.0, 0.0, 0.0,]
pos_des = [ 0.0, 0.0, 0.0,]
acc_des = [ 10.0, 10.0, 10.0, 50.0, 50.0, 10.0,]
ctrl_point = [ 0.0, 0.0, 0.4,]
foot_pose = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,]
step_height = [ 50010.0, 10050.0,]
value = 0
duration = 240

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

0
task_3/Usergait_List.toml Normal file → Executable file
View File

View File

@ -25,7 +25,7 @@ robot_cmd = {
'foot_pose':[0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
'step_height':[0.0, 0.0],
'value':0, 'duration':0
}
}
def main():
lcm_cmd = lcm.LCM("udpm://239.255.76.67:7671?ttl=255")
@ -76,13 +76,28 @@ def main():
file_obj_gait_def.close()
file_obj_gait_params.close()
cmd_msg.mode = 62
cmd_msg.value = 0
cmd_msg.contact = 15
cmd_msg.gait_id = 110
cmd_msg.duration = 1000
cmd_msg.life_count += 1
for i in range(325): #15s Heat beat It is used to maintain the heartbeat when life count is not updated
user_gait_list = open("Usergait_List.toml",'r')
steps = toml.load(user_gait_list)
for step in steps['step']:
cmd_msg.mode = step['mode']
cmd_msg.value = step['value']
cmd_msg.contact = step['contact']
cmd_msg.gait_id = step['gait_id']
cmd_msg.duration = step['duration']
cmd_msg.life_count += 1
for i in range(3):
cmd_msg.vel_des[i] = step['vel_des'][i]
cmd_msg.rpy_des[i] = step['rpy_des'][i]
cmd_msg.pos_des[i] = step['pos_des'][i]
cmd_msg.acc_des[i] = step['acc_des'][i]
cmd_msg.acc_des[i+3] = step['acc_des'][i+3]
cmd_msg.foot_pose[i] = step['foot_pose'][i]
cmd_msg.ctrl_point[i] = step['ctrl_point'][i]
for i in range(2):
cmd_msg.step_height[i] = step['step_height'][i]
lcm_cmd.publish("robot_control_cmd",cmd_msg.encode())
time.sleep( 0.1 )
for i in range(999): #15s Heat beat It is used to maintain the heartbeat when life count is not updated
lcm_cmd.publish("robot_control_cmd",cmd_msg.encode())
time.sleep( 0.2 )
except KeyboardInterrupt: