20 const std::shared_ptr<const IHexapodCoordinateConverter>& converter_ptr) :
21 kRightLegGroundPointColor(GetColor(230, 15, 145)),
22 kLeftLegGroundPointColor(GetColor(15, 230, 145)),
23 kRightLegGroundPointDarkColor(GetColor(237, 159, 160)),
24 kLeftLegGroundPointDarkColor(GetColor(159, 237, 160)),
25 converter_ptr_(converter_ptr)
31 const std::vector<RobotStateNode>& node,
const std::vector<size_t>& simulation_end_node_index)
33 while (loaded_node_num_ < node.size())
35 int simulation_num = 0;
37 for (
size_t i = 0; i < simulation_end_node_index.size(); i++)
39 if (simulation_end_node_index[i] >= loaded_node_num_)
48 while (simulation_num >= ground_point_.size())
50 ground_point_.push_back({});
55 std::array<VectorAndIsGround, HexapodConst::kLegNum> ground_point;
60 converter_ptr_->ConvertLegToGlobalCoordinate(
61 node[loaded_node_num_].leg_pos[i], i, node[loaded_node_num_].center_of_mass_global_coord, node[loaded_node_num_].posture,
true),
66 ground_point_[simulation_num].push_back(ground_point);
75 unsigned int color[6] = { kRightLegGroundPointColor, kRightLegGroundPointColor, kRightLegGroundPointColor,
76 kLeftLegGroundPointColor, kLeftLegGroundPointColor, kLeftLegGroundPointColor };
78 unsigned int color_black[6] = { kRightLegGroundPointDarkColor, kRightLegGroundPointDarkColor, kRightLegGroundPointDarkColor,
79 kLeftLegGroundPointDarkColor, kLeftLegGroundPointDarkColor, kLeftLegGroundPointDarkColor };
81 for (
size_t i = 0; i < ground_point_.size(); i++)
83 for (
auto& leg_data : ground_point_[i])
87 if (!leg_data[leg_index].is_ground)
92 if (draw_all_simulation || i == draw_simulation_num)
98 SetDrawBlendMode(DX_BLENDMODE_ALPHA, 32);
102 SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 0);
bool IsGrounded(const LegStateBit &leg_state, const int leg_index)
脚番号 leg_index 0 ~ 5 に応じて,その脚が接地しているかを調べる. 脚は右前脚を0番として,時計回りに0,1,2,3,4,5となる.左前足が5番.