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

Update abc posik ggtest #1052

Merged
merged 2 commits into from
Oct 19, 2016
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
2 changes: 1 addition & 1 deletion rtc/AutoBalancer/AutoBalancer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ RTC::ReturnCode_t AutoBalancer::onInitialize()
has_ik_failed = false;
is_hand_fix_mode = false;

pos_ik_thre = 0.1*1e-3; // [m]
pos_ik_thre = 0.5*1e-3; // [m]
rot_ik_thre = (1e-2)*M_PI/180.0; // [rad]
ik_error_debug_print_freq = static_cast<int>(0.2/m_dt); // once per 0.2 [s]

Expand Down
1 change: 1 addition & 0 deletions rtc/AutoBalancer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ add_test(testGaitGeneratorTest12 testGaitGenerator --test12 --use-gnuplot false)
add_test(testGaitGeneratorTest13 testGaitGenerator --test13 --use-gnuplot false)
add_test(testGaitGeneratorTest14 testGaitGenerator --test14 --use-gnuplot false)
add_test(testGaitGeneratorTest15 testGaitGenerator --test15 --use-gnuplot false)
#add_test(testGaitGeneratorTest16 testGaitGenerator --test16 --use-gnuplot false)

install(TARGETS ${target}
RUNTIME DESTINATION bin
Expand Down
31 changes: 31 additions & 0 deletions rtc/AutoBalancer/testGaitGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,34 @@ class testGaitGenerator
gen_and_plot_walk_pattern();
};

void test16 ()
{
std::cerr << "test16 : Set foot steps with param (toe heel contact)" << std::endl;
/* initialize sample footstep_list */
parse_params();
gg->clear_footstep_nodes_list();
gg->set_toe_zmp_offset_x(137*1e-3);
gg->set_heel_zmp_offset_x(-105*1e-3);
gg->set_toe_pos_offset_x(137*1e-3);
gg->set_heel_pos_offset_x(-105*1e-3);
gg->set_toe_angle(20);
gg->set_heel_angle(5);
gg->set_default_step_time(1);
gg->set_default_double_support_ratio_before(0.1);
gg->set_default_double_support_ratio_after(0.1);
gg->set_use_toe_heel_transition(true);
double ratio[7] = {0.02, 0.28, 0.2, 0.0, 0.2, 0.25, 0.05};
std::vector<double> ratio2(ratio, ratio+gg->get_NUM_TH_PHASES());
gg->set_toe_heel_phase_ratio(ratio2);
std::vector< std::vector<step_node> > fnsl;
fnsl.push_back(boost::assign::list_of(step_node("rleg", coordinates(hrp::Vector3(hrp::Vector3(0, 0, 0)+leg_pos[0])), gg->get_default_step_height()*0.5, gg->get_default_step_time()*0.5, gg->get_toe_angle()*0.5, gg->get_heel_angle()*0.5)));
fnsl.push_back(boost::assign::list_of(step_node("lleg", coordinates(hrp::Vector3(hrp::Vector3(100*1e-3, 0, 0)+leg_pos[1])), gg->get_default_step_height()*2.0, gg->get_default_step_time()*2.0, gg->get_toe_angle()*2.0, gg->get_heel_angle()*2.0)));
fnsl.push_back(boost::assign::list_of(step_node("rleg", coordinates(hrp::Vector3(hrp::Vector3(400*1e-3, 0, 0)+leg_pos[0])), gg->get_default_step_height()*0.5, gg->get_default_step_time()*0.5, gg->get_toe_angle()*0.5, gg->get_heel_angle()*0.5)));
fnsl.push_back(boost::assign::list_of(step_node("lleg", coordinates(hrp::Vector3(hrp::Vector3(400*1e-3, 0, 0)+leg_pos[1])), gg->get_default_step_height()*2.0, gg->get_default_step_time()*2.0, gg->get_toe_angle()*2.0, gg->get_heel_angle()*2.0)));
gg->set_foot_steps_list(fnsl);
gen_and_plot_walk_pattern();
};

void parse_params ()
{
for (unsigned int i = 0; i < arg_strs.size(); ++ i) {
Expand Down Expand Up @@ -778,6 +806,7 @@ void print_usage ()
std::cerr << " --test13 : Arbitrary leg switching" << std::endl;
std::cerr << " --test14 : kick walk" << std::endl;
std::cerr << " --test15 : Stair walk down" << std::endl;
std::cerr << " --test16 : Set foot steps with param (toe heel contact)" << std::endl;
};

int main(int argc, char* argv[])
Expand Down Expand Up @@ -820,6 +849,8 @@ int main(int argc, char* argv[])
tgg.test14();
} else if (std::string(argv[1]) == "--test15") {
tgg.test15();
} else if (std::string(argv[1]) == "--test16") {
tgg.test16();
} else {
print_usage();
ret = 1;
Expand Down