RosReflexxesPositionInterface.h
Go to the documentation of this file.
1 #ifndef ROS_REFLEXXES_POSITION_INTERFACE_H
2 #define ROS_REFLEXXES_POSITION_INTERFACE_H
3 
4 #include <ros/ros.h>
9 
11 
13 {
14 private:
16  //paramers
17  int n_dim_ = 0;
18  double period_ = 0;
19  std::vector<double> max_velocities_;
20  std::vector<double> max_acceleration_;
21  std::vector<double> max_jerk_;
22 
23 
28  bool position_initialized_ = false;;
29 
30  //functions
31  bool load_parameters(std::string ns);
32 
33 public:
34 
35  /**********************************************
36  * methods implemented for RosReflexxesInterface
37  */
38 
39  RosReflexxesPositionInterface() : max_acceleration_(0), max_velocities_(0), max_jerk_(0) {};
43 
44  bool init(ros::NodeHandle nh) override;
45  void starting(const std::vector<double> &c_pos) override;
46  std::vector<double> update() override;//advance reflexxes and returns next position
47 
48  std::vector<double> get_target_command() override {
49  return get_target_position();
50  };
51 
52  void set_target_command(const std::vector<double> &command) override {
53  set_target_position(command);
54  };
55 
56 
57  std::vector<double> get_current_position() override;
58  std::vector<double> get_current_velocity() override;
59  std::vector<double> get_current_acceleration() override;
60 
61  /**********************************************
62  * custom methods
63  */
64 
66  void advance_reflexxes();//advance reflexxes if initialized and position is known
67 
68  //getter functions
69  std::vector<double> get_target_position();
72 
73  //setter functions
74  void set_target_position(const std::vector<double> &t_pos) override;
75  void set_target_velocity(const std::vector<double> &t_vel) override;
76 
77 };
78 
79 
80 #endif
std::vector< double > get_current_acceleration() override
boost::shared_ptr< RMLPositionInputParameters > input_params_
std::vector< double > update() override
void reset_to_previous_state(RMLPositionInputParameters previous_state)
std::vector< double > get_current_position() override
void set_target_command(const std::vector< double > &command) override
boost::shared_ptr< RMLPositionOutputParameters > output_params_
std::vector< double > get_current_velocity() override
bool init(ros::NodeHandle nh) override
RMLPositionInputParameters get_current_state()
boost::shared_ptr< ReflexxesAPI > rml_
void starting(const std::vector< double > &c_pos) override
std::vector< double > get_target_command() override
void set_target_velocity(const std::vector< double > &t_vel) override
void set_target_position(const std::vector< double > &t_pos) override


ros_reflexxes
Author(s):
autogenerated on Sat Nov 21 2020 03:17:43