Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix foot step limitation in case of offset vel is specified. Fix testing code. #1162

Merged
merged 1 commit into from
Jun 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions rtc/AutoBalancer/GaitGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1002,12 +1002,12 @@ namespace rats
dy = std::max(-1 * footstep_param.stride_y / default_step_time, std::min(footstep_param.stride_y / default_step_time, dy ));
/* inside step limitation */
if (use_inside_step_limitation) {
if (cur_vel_param.velocity_y > 0) {
if (dy > 0) {
if (std::count_if(sup_fns.begin(), sup_fns.end(), (&boost::lambda::_1->* &step_node::l_r == LLEG || &boost::lambda::_1->* &step_node::l_r == LARM)) > 0) dy *= 0.5;
} else {
if (std::count_if(sup_fns.begin(), sup_fns.end(), (&boost::lambda::_1->* &step_node::l_r == RLEG || &boost::lambda::_1->* &step_node::l_r == RARM)) > 0) dy *= 0.5;
}
if (cur_vel_param.velocity_theta > 0) {
if (dth > 0) {
if (std::count_if(sup_fns.begin(), sup_fns.end(), (&boost::lambda::_1->* &step_node::l_r == LLEG || &boost::lambda::_1->* &step_node::l_r == LARM)) > 0) dth *= 0.5;
} else {
if (std::count_if(sup_fns.begin(), sup_fns.end(), (&boost::lambda::_1->* &step_node::l_r == RLEG || &boost::lambda::_1->* &step_node::l_r == RARM)) > 0) dth *= 0.5;
Expand Down
11 changes: 6 additions & 5 deletions sample/SampleRobot/samplerobot_auto_balancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,16 +670,17 @@ def demoGaitGeneratorGrasplessManipMode():
gv_pose_list = [av_fwd, av_bwd, av_left, av_right, av_lturn, av_rturn]
ref_footmid_diff = [[50*1e-3,0,0],
[-50*1e-3,0,0],
[0, 0.5*50*1e-3,0], # 0.5->inside limitation
[0,-0.5*50*1e-3,0], # 0.5->inside limitation
[0,0, 0.5*10], # 0.5->inside limitation
[0,0,-0.5*10]] # 0.5->inside limitation
[0, 50*1e-3,0],
[0,-50*1e-3,0],
[0,0, 10],
[0,0,-10]]
ret=True
hcf.abc_svc.waitFootSteps()
for idx in range(len(gv_pose_list)):
pose = gv_pose_list[idx]
prev_dst_foot_midcoords=hcf.abc_svc.getFootstepParam()[1].dst_foot_midcoords
hcf.abc_svc.goVelocity(0,0,0);
yvel = -0.0001 if (idx%2==0) else 0.0001 # Iff even number test, start with rleg. Otherwise, lleg.
hcf.abc_svc.goVelocity(0,yvel,0);
hcf.seq_svc.setJointAngles(pose, 0.4)
hcf.waitInterpolation()
hcf.seq_svc.setJointAngles(pose, 1.6);hcf.waitInterpolation() # Dummy 2step
Expand Down