Body tree description of a kinematic chain.
#include <fsb_body_tree.h>
|
| BodyTree ()=default |
| Construct a new BodyTree object.
|
|
size_t | add_body (size_t parent_body_index, JointType joint_type, const Transform &parent_joint_transform, const Body &body, BodyTreeError &err) |
| Add a body to the body tree.
|
|
size_t | add_massless_body (size_t parent_body_index, JointType joint_type, const Transform &parent_joint_transform, const MotionVector &origin_offset, BodyTreeError &err) |
| Add a massless body to the body tree.
|
|
void | set_gravity (const Vec3 &gravity) |
| Set the gravity vector.
|
|
Joint | get_joint (size_t joint_index, BodyTreeError &err) const |
| Get a joint object in the body tree.
|
|
Body | get_body (size_t body_index, BodyTreeError &err) const |
| Get body object from tree.
|
|
BodyTreeError | set_body_mass_props (size_t body_index, const MassProps &mass_props) |
| Set the body mass properties object.
|
|
BodyTreeError | set_body_origin_offset (size_t body_index, const MotionVector &origin_offset) |
| Set the body transform offset.
|
|
BodyTreeError | set_parent_joint_transform (size_t body_index, const Transform &parent_joint_transform) |
| Set the parent joint transform object.
|
|
size_t | get_body_dofs (size_t body_index, BodyTreeError &err) const |
| Get the number of degrees of freedom for a body.
|
|
size_t | get_num_bodies () const |
| Get the number of bodies in tree.
|
|
size_t | get_num_dofs () const |
| Get the number of body tree degrees of freedom.
|
|
size_t | get_num_coordinates () const |
| Get the number of generalized position coordinates.
|
|
Vec3 | get_gravity () const |
| Get the gravity vector.
|
|
std::array< size_t, MaxSize::bodies > | get_leaves (size_t &num_leaves) const |
| Get a list of body indexes that are leaves (bodies without children)
|
|
|
static constexpr size_t | base_index = 0U |
| Index of base body is always 0.
|
|
◆ add_body()
Add a body to the body tree.
- Parameters
-
parent_body_index | Index of parent body |
joint_type | Joint type |
parent_joint_transform | Transform of joint with respect to parent body |
body | Body to add to tree |
err | Error code |
- Returns
- Index of added body
◆ add_massless_body()
Add a massless body to the body tree.
- Parameters
-
parent_body_index | Index of parent body |
joint_type | Joint type |
parent_joint_transform | Transform of joint with respect to parent body |
origin_offset | Origin offset transform |
err | Error code |
- Returns
- Index of added body
◆ get_body_dofs()
size_t fsb::BodyTree::get_body_dofs |
( |
size_t |
body_index, |
|
|
BodyTreeError & |
err |
|
) |
| const |
Get the number of degrees of freedom for a body.
- Parameters
-
body_index | Body index |
err | Error code |
- Returns
- Number of degrees of freedom
◆ get_gravity()
Vec3 fsb::BodyTree::get_gravity |
( |
| ) |
const |
|
inline |
Get the gravity vector.
- Returns
- Gravity acceleration vector
◆ get_leaves()
std::array< size_t, MaxSize::bodies > fsb::BodyTree::get_leaves |
( |
size_t & |
num_leaves | ) |
const |
|
inline |
Get a list of body indexes that are leaves (bodies without children)
- Parameters
-
num_leaves | Number of leaves in body tree |
- Returns
- Array of body indexes which are leaves.
◆ get_num_bodies()
size_t fsb::BodyTree::get_num_bodies |
( |
| ) |
const |
|
inline |
Get the number of bodies in tree.
- Returns
- Number of bodies
◆ get_num_coordinates()
size_t fsb::BodyTree::get_num_coordinates |
( |
| ) |
const |
|
inline |
Get the number of generalized position coordinates.
- Returns
- Number of generalized position coordinates
◆ get_num_dofs()
size_t fsb::BodyTree::get_num_dofs |
( |
| ) |
const |
|
inline |
Get the number of body tree degrees of freedom.
- Returns
- Degrees of freedom
◆ set_gravity()
void fsb::BodyTree::set_gravity |
( |
const Vec3 & |
gravity | ) |
|
|
inline |
Set the gravity vector.
- Parameters
-
The documentation for this class was generated from the following files: