orogen/ctrl_lib
CartesianForceController.hpp
Go to the documentation of this file.
1/* Generated from orogen/lib/orogen/templates/tasks/Task.hpp */
2
3#ifndef CTRL_LIB_CARTESIANFORCECONTROLLER_TASK_HPP
4#define CTRL_LIB_CARTESIANFORCECONTROLLER_TASK_HPP
5
6#include "ctrl_lib/CartesianForceControllerBase.hpp"
7#include <base/samples/Wrenches.hpp>
8#include <base/samples/RigidBodyState.hpp>
9#include <base/samples/RigidBodyStateSE3.hpp>
10#include <wbc/controllers/CartesianForcePIDController.hpp>
11
12namespace ctrl_lib{
13
14class CartesianForcePIDController;
15
17class CartesianForceController : public CartesianForceControllerBase
18{
19 friend class CartesianForceControllerBase;
20
21public:
22 CartesianForceController(std::string const& name = "ctrl_lib::CartesianForceController");
23 CartesianForceController(std::string const& name, RTT::ExecutionEngine* engine);
25 bool configureHook();
26 bool startHook();
27 void updateHook();
28 void errorHook();
29 void stopHook();
30 void cleanupHook();
31
32protected:
34 virtual bool readFeedback();
36 virtual bool readSetpoint();
38 virtual void updateController();
40 virtual const base::VectorXd& computeActivation(wbc::ActivationFunction& activation_function);
41
42
43 bool isValid(const base::Wrench &w){
44 return !base::isNaN(w.force(0)) && !base::isNaN(w.force(1)) && !base::isNaN(w.force(2)) &&
45 !base::isNaN(w.torque(0)) && !base::isNaN(w.torque(1)) && !base::isNaN(w.torque(2));
46 }
47
48 const base::VectorXd wrenchToRaw(const base::samples::Wrench& wrench, base::VectorXd& raw){
49 raw.resize(6);
50 raw.segment(0,3) = wrench.force;
51 raw.segment(3,3) = wrench.torque;
52 return raw;
53 }
54
55 base::samples::Wrench setpoint, feedback;
56 base::samples::Wrenches feedback_wrenches;
57 std::string ft_sensor_name;
59 base::samples::RigidBodyStateSE3 control_output;
60 wbc::CartesianForcePIDController* controller;
61
62};
63}
64
65#endif
66
Definition CartesianForceController.hpp:18
void errorHook()
Definition CartesianForceController.cpp:47
base::VectorXd setpoint_raw
Definition CartesianForceController.hpp:58
std::string ft_sensor_name
Definition CartesianForceController.hpp:57
virtual void updateController()
Definition CartesianForceController.cpp:98
void stopHook()
Definition CartesianForceController.cpp:51
bool isValid(const base::Wrench &w)
Definition CartesianForceController.hpp:43
void cleanupHook()
Definition CartesianForceController.cpp:55
base::samples::Wrench feedback
Definition CartesianForceController.hpp:55
base::samples::Wrenches feedback_wrenches
Definition CartesianForceController.hpp:56
virtual bool readSetpoint()
Definition CartesianForceController.cpp:85
virtual const base::VectorXd & computeActivation(wbc::ActivationFunction &activation_function)
Definition CartesianForceController.cpp:106
void updateHook()
Definition CartesianForceController.cpp:43
base::VectorXd ctrl_output_raw
Definition CartesianForceController.hpp:58
bool configureHook()
Definition CartesianForceController.cpp:17
virtual bool readFeedback()
Definition CartesianForceController.cpp:60
base::VectorXd feedback_raw
Definition CartesianForceController.hpp:58
~CartesianForceController()
Definition CartesianForceController.hpp:24
const base::VectorXd wrenchToRaw(const base::samples::Wrench &wrench, base::VectorXd &raw)
Definition CartesianForceController.hpp:48
CartesianForceController(std::string const &name="ctrl_lib::CartesianForceController")
Definition CartesianForceController.cpp:9
wbc::CartesianForcePIDController * controller
Definition CartesianForceController.hpp:60
base::samples::RigidBodyStateSE3 control_output
Definition CartesianForceController.hpp:59
base::samples::Wrench setpoint
Definition CartesianForceController.hpp:55
bool startHook()
Definition CartesianForceController.cpp:35
Definition CartesianForceController.hpp:12