RobotData.h
Go to the documentation of this file.
1 /*
2  * Copyright 2015-2022 CNRS-UM LIRMM, CNRS-AIST JRL
3  */
4 
5 #pragma once
6 
8 #include <mc_rbdyn/BodySensor.h>
9 #include <mc_rbdyn/Flexibility.h>
10 #include <mc_rbdyn/ForceSensor.h>
11 #include <mc_rbdyn/JointSensor.h>
12 #include <mc_rbdyn/Springs.h>
13 
14 #include <memory>
15 #include <vector>
16 
17 namespace mc_rbdyn
18 {
19 
20 struct Robot;
21 
33 struct RobotData
34 {
36  std::vector<std::string> refJointOrder;
38  std::vector<double> encoderValues;
40  std::vector<double> encoderVelocities;
42  std::vector<double> jointTorques;
43  /* Force sensors */
44  std::vector<ForceSensor> forceSensors;
46  std::unordered_map<std::string, size_t> forceSensorsIndex;
48  std::unordered_map<std::string, size_t> bodyForceSensors_;
52  std::unordered_map<std::string, size_t> bodySensorsIndex;
54  std::unordered_map<std::string, size_t> bodyBodySensors;
56  std::vector<JointSensor> jointSensors;
58  std::unordered_map<std::string, size_t> jointJointSensors;
60  std::unordered_map<std::string, mc_control::GripperPtr> grippers;
62  std::vector<mc_control::GripperRef> grippersRef;
66  std::unordered_map<std::string, size_t> devicesIndex;
70  std::vector<Robot *> robots;
71 };
72 
73 using RobotDataPtr = std::shared_ptr<RobotData>;
74 
75 } // namespace mc_rbdyn
mc_rbdyn::RobotData::bodyForceSensors_
std::unordered_map< std::string, size_t > bodyForceSensors_
Definition: RobotData.h:48
mc_rbdyn::RobotData::forceSensors
std::vector< ForceSensor > forceSensors
Definition: RobotData.h:44
mc_rbdyn::DevicePtrVector
Definition: RobotModule.h:41
generic_gripper.h
mc_rbdyn::RobotData::grippersRef
std::vector< mc_control::GripperRef > grippersRef
Definition: RobotData.h:62
mc_rbdyn::RobotData
Definition: RobotData.h:33
mc_rbdyn::RobotData::robots
std::vector< Robot * > robots
Definition: RobotData.h:70
mc_rbdyn::RobotData::bodySensors
BodySensorVector bodySensors
Definition: RobotData.h:50
BodySensor.h
mc_rbdyn::RobotDataPtr
std::shared_ptr< RobotData > RobotDataPtr
Definition: RobotData.h:73
Flexibility.h
mc_rbdyn::RobotData::devicesIndex
std::unordered_map< std::string, size_t > devicesIndex
Definition: RobotData.h:66
mc_rbdyn::RobotData::forceSensorsIndex
std::unordered_map< std::string, size_t > forceSensorsIndex
Definition: RobotData.h:46
mc_rbdyn::RobotData::jointJointSensors
std::unordered_map< std::string, size_t > jointJointSensors
Definition: RobotData.h:58
mc_rbdyn::RobotData::encoderValues
std::vector< double > encoderValues
Definition: RobotData.h:38
mc_rbdyn::RobotData::devices
DevicePtrVector devices
Definition: RobotData.h:64
ForceSensor.h
mc_rbdyn::BodySensorVector
std::vector< BodySensor, Eigen::aligned_allocator< BodySensor > > BodySensorVector
Definition: BodySensor.h:145
mc_rbdyn::RobotData::grippers
std::unordered_map< std::string, mc_control::GripperPtr > grippers
Definition: RobotData.h:60
mc_rbdyn::RobotData::bodyBodySensors
std::unordered_map< std::string, size_t > bodyBodySensors
Definition: RobotData.h:54
mc_rbdyn::RobotData::jointSensors
std::vector< JointSensor > jointSensors
Definition: RobotData.h:56
JointSensor.h
Springs.h
mc_rbdyn::RobotData::encoderVelocities
std::vector< double > encoderVelocities
Definition: RobotData.h:40
mc_rbdyn::RobotData::jointTorques
std::vector< double > jointTorques
Definition: RobotData.h:42
mc_rbdyn
Definition: generic_gripper.h:14
mc_rtc::gui::Robot
auto Robot(const std::string &name, GetT get_fn)
Definition: Robot.h:56
mc_rbdyn::RobotData::refJointOrder
std::vector< std::string > refJointOrder
Definition: RobotData.h:36
mc_rbdyn::RobotData::bodySensorsIndex
std::unordered_map< std::string, size_t > bodySensorsIndex
Definition: RobotData.h:52