15#ifndef DIFF_DRIVE_ROBOT_H
16#define DIFF_DRIVE_ROBOT_H
18#include "bitrl/bitrl_config.h"
30#include "chrono/physics/ChSystem.h"
31#include "chrono/physics/ChLinkMotorRotationSpeed.h"
37namespace rb::bitrl_chrono{
49class CHRONO_DiffDriveRobot final {
51 CHRONO_DiffDriveRobot(chrono::ChSystem& system,
52 const chrono::ChVector3d& robot_pos,
53 const chrono::ChQuaternion<>& robot_rot,
54 std::shared_ptr<chrono::ChContactMaterial> wheel_mat = {});
58 ~CHRONO_DiffDriveRobot()=
default;
65 void set_motor_speed(real_t rad_speed, uint_t
id);
68 chrono::ChVector3d get_active_wheel_speed(uint_t
id)
const;
71 chrono::ChVector3d get_active_wheel_angular_velocity(uint_t
id)
const;
74 const CHRONO_RobotPose& get_pose()
const{
return pose_;}
82 chrono::ChSystem* system_;
85 std::shared_ptr<CHRONO_DiffDriveRobot_Chassis> chassis_;
86 std::vector<std::shared_ptr<CHRONO_DiffDriveRobot_ActiveWheel>> drive_wheels_;
87 std::vector<std::shared_ptr<CHRONO_DiffDriveRobot_PassiveWheel>> passive_wheels_;
89 std::vector<std::shared_ptr<CHRONO_DiffDriveRobot_Rod_Short>> m_1st_level_rods_;
90 std::vector<std::shared_ptr<CHRONO_DiffDriveRobot_Rod_Short>> m_2nd_level_rods_;
91 std::vector<std::shared_ptr<CHRONO_DiffDriveRobot_Rod_Long>> m_3rd_level_rods_;
92 std::shared_ptr<CHRONO_DiffDriveRobot_BottomPlate> bottom_plate_;
93 std::shared_ptr<CHRONO_DiffDriveRobot_MiddlePlate> middle_plate_;
94 std::shared_ptr<CHRONO_DiffDriveRobot_TopPlate> top_plate_;
96 chrono::ChQuaternion<> robot_rot_;
97 chrono::ChVector3d robot_pos_;
99 std::vector<std::shared_ptr<chrono::ChLinkMotorRotationSpeed>> motors_;
100 std::vector<std::shared_ptr<chrono::ChFunctionConst>> motors_func_;
103 std::shared_ptr<chrono::ChContactMaterial> chassis_material_;
104 std::shared_ptr<chrono::ChContactMaterial> wheel_material_;
107 CHRONO_RobotPose pose_;
109 bool dc_motor_control_ =
false;
Definition bitrl_consts.h:14