1#ifndef BITSIM_RIGID_BODIES_CHRONO_ROBOTS_CHRONO_ROBOT_POSE_H
2#define BITSIM_RIGID_BODIES_CHRONO_ROBOTS_CHRONO_ROBOT_POSE_H
4#include "bitsim/bitsim_config.h"
7#include <chrono/physics/ChBody.h>
25 explicit CHRONO_RobotPose(std::shared_ptr<chrono::ChBody> robot_ptr =
nullptr);
31 void set_body(std::shared_ptr<chrono::ChBody> robot_ptr) { robot_ptr_ = robot_ptr; }
36 const chrono::ChVector3d &
position()
const {
return robot_ptr_->GetPos(); }
41 const chrono::ChVector3d &
velocity()
const {
return robot_ptr_->GetLinVel(); }
46 const chrono::ChVector3d &
acceleration()
const {
return robot_ptr_->GetLinAcc(); }
51 const chrono::ChMatrix33d &
rotation_matrix()
const {
return robot_ptr_->GetRotMat(); }
58 return robot_ptr_->GetFrameRefToAbs().TransformPointLocalToParent(point);
66 return robot_ptr_->GetFrameRefToAbs().TransformPointParentToLocal(point);
73 std::shared_ptr<chrono::ChBody> robot_ptr_;
77 : robot_ptr_(robot_ptr)
chrono::ChVector3d to_local_coords(chrono::ChVector3d point)
Transform the world point to local coordinates.
Definition chrono_robot_pose.h:64
const chrono::ChVector3d & velocity() const
Definition chrono_robot_pose.h:41
CHRONO_RobotPose(std::shared_ptr< chrono::ChBody > robot_ptr=nullptr)
Constructor. Initialize by passing a pointer to the chrono::ChBody to monitor.
Definition chrono_robot_pose.h:76
const chrono::ChVector3d & acceleration() const
Definition chrono_robot_pose.h:46
void set_body(std::shared_ptr< chrono::ChBody > robot_ptr)
Definition chrono_robot_pose.h:31
const chrono::ChVector3d & position() const
Return the position vector. This is the position of the CoM of the body.
Definition chrono_robot_pose.h:36
const chrono::ChMatrix33d & rotation_matrix() const
Return the rotation matrix.
Definition chrono_robot_pose.h:51
chrono::ChVector3d to_world_coords(chrono::ChVector3d point)
Return the transformation of the local to the world coordinats.
Definition chrono_robot_pose.h:56
Definition chrono_robot_pose.h:11
Definition dc_motor_backend_base.h:9