Commit 3e4e19f9 authored by Paul Rouanet's avatar Paul Rouanet
Browse files

Tentative Constructeur et Destructeur

parent cb464785
......@@ -66,6 +66,14 @@ namespace Eigen
{
/** @brief Eigen shortcut for vector of size 6. */
typedef Matrix<double, 6, 1> Vector6d;
typedef Matrix<bool, 6, 1> Vector6b;
typedef Matrix<long, 6, 1> Vector6l;
typedef Matrix<int, 6, 1> Vector6i;
/** @brief Eigen shortcut for vector of size 3. */
typedef Matrix<long, 3, 1> Vector3l;
/** @brief Eigen shortcut for vector of size 4. */
typedef Matrix<long, 4, 1> Vector4l;
} // namespace Eigen
......@@ -119,6 +127,13 @@ class SystemBoltHardware : public
hardware_interface::BaseInterface<hardware_interface::SystemInterface>
{
public:
// Constructeur
SystemBoltHardware();
// Destructeur
~SystemBoltHardware();
RCLCPP_SHARED_PTR_DEFINITIONS(SystemBoltHardware)
ROS2_CONTROL_BOLT_PUBLIC
......@@ -173,8 +188,30 @@ private:
std::map<std::string,control_mode_t> new_modes_;
//Definition of multiple variables about Bolt
// Joint
Eigen::Vector6i motor_numbers;
Eigen::Vector6b motor_reversed;
Eigen::Vector6d joint_lower_limits;
Eigen::Vector6d joint_upper_limits;
// IMU
Eigen::Vector3l rotate_vector;
Eigen::Vector4l orientation_vector;
};
SystemBoltHardware::SystemBoltHardware()
{
motor_numbers << 0, 3, 2, 1, 5, 4;
motor_reversed << true, false, true, true, false, false;
joint_lower_limits << -0.5, -1.7, -3.4, -0.5, -1.7, -3.4; //Modif d'après lecture des capteurs (demo bolt)
joint_upper_limits << 0.5, 1.7, +3.4, +0.5, +1.7, +3.4; //Modif d'après lecture des capteurs (demo bolt)
rotate_vector << 1, 2, 3;
orientation_vector << 1, 2, 3, 4;
}
} // namespace ros2_control_bolt
#endif // ROS2_CONTROL_BOLT__SYSTEM_BOLT_HPP_
......@@ -31,36 +31,36 @@
using namespace odri_control_interface;
//using namespace Eigen;
using namespace Eigen;
#include <iostream>
#include <stdexcept>
typedef Eigen::Matrix<double, 6, 1> Vector6d;
SystemBoltHardware Bolt;
/*typedef Eigen::Matrix<double, 6, 1> Vector6d;
typedef Eigen::Matrix<bool, 6, 1> Vector6b;
typedef Eigen::Matrix<long, 3, 1> Vector3l;
typedef Eigen::Matrix<long, 4, 1> Vector4l;
typedef Eigen::Matrix<long, 6, 1> Vector6l;
typedef Eigen::Matrix<int, 6, 1> Vector6i;
typedef Eigen::Matrix<int, 6, 1> Vector6i;*/
// Define Bolt robot
//auto main_board_ptr_ = std::make_shared<MasterBoardInterface>(argv[1]);
//auto main_board_ptr_ = std::make_shared<MasterBoardInterface>("enp3s0");
/*Vector6i motor_numbers;
motor_numbers << 0, 3, 2, 1, 5, 4;*/
/*Vector6i motor_numbers(6,1);
motor_numbers(0,0) = 0;
motor_numbers(1,0) = 3;
motor_numbers(2,0) = 2;
motor_numbers(3,0) = 1;
motor_numbers(4,0) = 5;
motor_numbers(5,0) = 4;*/
/*Vector6i motor_numbers(6);
motor_numbers(0) = 0;
motor_numbers(1) = 3;
motor_numbers(2) = 2;
motor_numbers(3) = 1;
motor_numbers(4) = 5;
motor_numbers(5) = 4;*/
/*Vector6b motor_reversed;
motor_reversed << true, false, true, true, false, false;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment