cpp_robotics::Transform
2次元のロボットの座標を扱うクラス More...
#include <transform.hpp>
Public Types
Name | |
---|---|
using FLOATING_TYPE | value_type |
using Vector2< value_type > | vector_type |
Public Functions
Name | |
---|---|
Transform() =default Construct a new Field Vector 2 object. |
|
constexpr | Transform(const value_type _x, const value_type _y, const value_type _theta) Construct a new Field Vector 2 object. |
constexpr | Transform(const vector_type & _xy, const value_type _theta) Construct a new Field Vector 2 object. |
constexpr | Transform(const Transform & ) =default Construct a new Field Vector 2 object. |
constexpr vector_type | make_vector2() const xy成分のVector2を生成 |
constexpr void | set(value_type vx, value_type vy, value_type vtheta) |
value_type | distance() const 原点からxy座標までの距離を返す |
void | rotate(const value_type theta) 原点中心に回転 |
void | rotate(const value_type rotX, const value_type rotY, const value_type theta) 指定座標中心に回転 |
void | rotate(vector_type rotPos, const value_type theta) 指定座標中心に回転 |
void | set_polar(const value_type radius, const value_type angle, const value_type robotTheta) 極座標指定 |
bool | is_zero() const |
bool | is_zero_pos() const |
bool | is_zero_angle() const |
bool | has_nan() const |
constexpr bool | operator==(const Transform v) const |
constexpr bool | operator!=(const Transform & v) const |
constexpr Transform | operator+(const Transform & v) const |
constexpr Transform | operator-(const Transform & v) const |
constexpr Transform & | operator+=(const Transform & v) |
constexpr Transform & | operator-=(const Transform & v) |
constexpr Transform | operator+(const vector_type & v) const |
constexpr Transform | operator-(const vector_type & v) const |
constexpr Transform | operator+(const value_type angle) const |
constexpr Transform | operator-(const value_type angle) const |
constexpr Transform & | operator+=(const vector_type & v) |
constexpr Transform & | operator-=(const vector_type & v) |
constexpr Transform & | operator+=(const value_type angle) |
constexpr Transform & | operator-=(const value_type angle) |
constexpr Transform | operator*(const value_type value) const |
constexpr Transform | operator/(const value_type value) const |
constexpr Transform & | operator*=(const value_type value) |
constexpr Transform & | operator/=(const value_type value) |
value_type & | operator[](const int index) |
constexpr value_type | operator[](const int index) const |
constexpr value_type | get_angle(Transform & a, Transform & b) Get the Angle object. |
value_type | get_distance(Transform & a, Transform & b) Get the Distance object. |
Transform | get_lerp(Transform & a, Transform & b, const value_type t) lerp function |
constexpr Transform | origin() |
Public Attributes
Name | |
---|---|
value_type | x |
value_type | y |
value_type | theta |
Detailed Description
template <typename FLOATING_TYPE >
struct cpp_robotics::Transform;
2次元のロボットの座標を扱うクラス
Public Types Documentation
using value_type
using cpp_robotics::Transform< FLOATING_TYPE >::value_type = FLOATING_TYPE;
using vector_type
using cpp_robotics::Transform< FLOATING_TYPE >::vector_type = Vector2<value_type>;
Public Functions Documentation
function Transform
Transform() =default
Construct a new Field Vector 2 object.
function Transform
inline constexpr Transform(
const value_type _x,
const value_type _y,
const value_type _theta
)
Construct a new Field Vector 2 object.
Parameters:
- x
- y
- theta
function Transform
inline constexpr Transform(
const vector_type & _xy,
const value_type _theta
)
Construct a new Field Vector 2 object.
function Transform
constexpr Transform(
const Transform &
) =default
Construct a new Field Vector 2 object.
Parameters:
- v
function make_vector2
inline constexpr vector_type make_vector2() const
xy成分のVector2を生成
function set
inline constexpr void set(
value_type vx,
value_type vy,
value_type vtheta
)
Parameters:
- vx
- vy
- vtheta
function distance
inline value_type distance() const
原点からxy座標までの距離を返す
Return: value_type
function rotate
inline void rotate(
const value_type theta
)
原点中心に回転
Parameters:
- theta
function rotate
inline void rotate(
const value_type rotX,
const value_type rotY,
const value_type theta
)
指定座標中心に回転
Parameters:
- rotX
- rotY
- theta
function rotate
inline void rotate(
vector_type rotPos,
const value_type theta
)
指定座標中心に回転
Parameters:
- rotPos
- theta
function set_polar
inline void set_polar(
const value_type radius,
const value_type angle,
const value_type robotTheta
)
極座標指定
Parameters:
- radius
- angle
- robotTheta
function is_zero
inline bool is_zero() const
Return:
- true
- false
function is_zero_pos
inline bool is_zero_pos() const
Return:
- true
- false
function is_zero_angle
inline bool is_zero_angle() const
Return:
- true
- false
function has_nan
inline bool has_nan() const
Return:
- true
- false
function operator==
inline constexpr bool operator==(
const Transform v
) const
Parameters:
- v
Return:
- true
- false
function operator!=
inline constexpr bool operator!=(
const Transform & v
) const
Parameters:
- v
Return:
- true
- false
function operator+
inline constexpr Transform operator+(
const Transform & v
) const
Parameters:
- v
Return: Transform
function operator-
inline constexpr Transform operator-(
const Transform & v
) const
Parameters:
- v
Return: Transform
function operator+=
inline constexpr Transform & operator+=(
const Transform & v
)
Parameters:
- v
Return: Transform&
function operator-=
inline constexpr Transform & operator-=(
const Transform & v
)
Parameters:
- v
Return: Transform&
function operator+
inline constexpr Transform operator+(
const vector_type & v
) const
Parameters:
- v
Return: Transform
function operator-
inline constexpr Transform operator-(
const vector_type & v
) const
Parameters:
- v
Return: Transform
function operator+
inline constexpr Transform operator+(
const value_type angle
) const
Parameters:
- angle
Return: Transform
function operator-
inline constexpr Transform operator-(
const value_type angle
) const
Parameters:
- angle
Return: Transform
function operator+=
inline constexpr Transform & operator+=(
const vector_type & v
)
Parameters:
- v
Return: Transform&
function operator-=
inline constexpr Transform & operator-=(
const vector_type & v
)
Parameters:
- v
Return: Transform&
function operator+=
inline constexpr Transform & operator+=(
const value_type angle
)
Parameters:
- angle
Return: Transform&
function operator-=
inline constexpr Transform & operator-=(
const value_type angle
)
Parameters:
- angle
Return: Transform&
function operator*
inline constexpr Transform operator*(
const value_type value
) const
Parameters:
- value
Return: Transform
function operator/
inline constexpr Transform operator/(
const value_type value
) const
Parameters:
- value
Return: Transform
function operator*=
inline constexpr Transform & operator*=(
const value_type value
)
Parameters:
- value
Return: Transform&
function operator/=
inline constexpr Transform & operator/=(
const value_type value
)
Parameters:
- value
Return: Transform&
function operator[]
inline value_type & operator[](
const int index
)
Parameters:
- index
Return: value_type&
function operator[]
inline constexpr value_type operator[](
const int index
) const
Parameters:
- index
Return: constexpr value_type
function get_angle
static inline constexpr value_type get_angle(
Transform & a,
Transform & b
)
Get the Angle object.
Parameters:
- a
- b
Return: value_type
function get_distance
static inline value_type get_distance(
Transform & a,
Transform & b
)
Get the Distance object.
Parameters:
- a
- b
Return: value_type
function get_lerp
static inline Transform get_lerp(
Transform & a,
Transform & b,
const value_type t
)
lerp function
Parameters:
- a
- b
- t
Return: Transform
function origin
static inline constexpr Transform origin()
Return: Transform
Public Attributes Documentation
variable x
value_type x;
variable y
value_type y;
variable theta
value_type theta;
Updated on 2024-05-28 at 06:55:40 +0000