libalmath  2.5.7.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
avoidfootcollision.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012 Aldebaran Robotics. All rights reserved.
3  * Use of this source code is governed by a BSD-style license that can be
4  * found in the COPYING file.
5  */
6 
7 
8 #pragma once
9 #ifndef _LIBALMATH_ALMATH_TOOLS_AVOIDFOOTCOLLISION_H_
10 #define _LIBALMATH_ALMATH_TOOLS_AVOIDFOOTCOLLISION_H_
11 
12 #include <almath/types/alpose2d.h>
14 #include <vector>
15 
16 namespace AL
17 {
18  namespace Math
19  {
31  const bool avoidFootCollision(
32  const std::vector<Position2D>& pLFootBoundingBox,
33  const std::vector<Position2D>& pRFootBoundingBox,
34  const bool& pIsLeftSupport,
35  Pose2D& pMove);
36 
37 
48  const bool clipFootWithEllipse(
49  const float& pMaxFootX,
50  const float& pMaxFootY,
51  Pose2D& pMove);
52 
53  // <summary> Query if the box A and the box B are in collision. </summary>
54  // <param name="pBoxA"> vector<Position2D> of the box A. </param>
55  // <param name="pBoxB"> vector<Position2D> of the box B. </param>
56  // <returns> true if box A and the box B are in collision. </returns>
57  const bool areTwoBoxesInCollision(
58  const std::vector<Position2D>& pBoxA,
59  const std::vector<Position2D>& pBoxB);
60 
61  // <summary> Compute the box point due to a move. </summary>
62  // <param name="pInitBox"> vector<Position2D> of the fixed box. </param>
63  // <param name="pMove"> Pose2D the initial move. </param>
64  // <param name> vector<Position2D> the new box. </returns>
65  void computeBox(
66  const std::vector<Position2D>& pInitBox,
67  const Pose2D& pMove,
68  std::vector<Position2D>& pMovedBox);
69 
70  // <summary> Compute the best orientation of the moving box without
71  // collsion with fixed box. </summary>
72  // <param name="pFixesBox"> vector<Position2D> of the fixed box. </param>
73  // <param name="pMovingBox"> vector<Position2D> of the moving box. </param>
74  // <param name="pMove"> Pose2D of moving box respect to fix box. </param>
75  // <returns> Pose2D, the best position. </returns>
76  const void dichotomie(
77  const std::vector<Position2D>& pFixedBox,
78  const std::vector<Position2D>& pMovingBox,
79  Pose2D& pMove);
80 
81  // <summary> Checks if segment A intersects segment B. </summary>
82  // <param name="pA1"> first point of segment A. </param>
83  // <param name="pA2"> second point of segment A. </param>
84  // <param name="pB1"> first point of segment B. </param>
85  // <param name="pB2"> second point of segment B. </param>
86  // <param name="pC"> computed intersection point. </param>
87  // <returns> true if the segments intersect in a single point (pC). </returns>
89  const Position2D &pA1,
90  const Position2D &pA2,
91  const Position2D &pB1,
92  const Position2D &pB2,
93  Position2D &pC);
94 
95  } // namespace Math
96 } // namespace AL
97 
98 #endif // _LIBALMATH_ALMATH_TOOLS_AVOIDFOOTCOLLISION_H_
99 
bool intersectionSegment2D(const Position2D &pA1, const Position2D &pA2, const Position2D &pB1, const Position2D &pB2, Position2D &pC)
const bool clipFootWithEllipse(const float &pMaxFootX, const float &pMaxFootY, Pose2D &pMove)
Clip foot move with ellipsoid function
void computeBox(const std::vector< Position2D > &pInitBox, const Pose2D &pMove, std::vector< Position2D > &pMovedBox)
const bool avoidFootCollision(const std::vector< Position2D > &pLFootBoundingBox, const std::vector< Position2D > &pRFootBoundingBox, const bool &pIsLeftSupport, Pose2D &pMove)
Compute the best position(orientation) of the foot to avoid collision.
const bool areTwoBoxesInCollision(const std::vector< Position2D > &pBoxA, const std::vector< Position2D > &pBoxB)
const void dichotomie(const std::vector< Position2D > &pFixedBox, const std::vector< Position2D > &pMovingBox, Pose2D &pMove)