#include <movement_publisher.hpp>
|
| void | add_movement (PartialMovement mvt) |
| |
| void | calculateErrorCallback (const control_msgs::JointControllerState::ConstPtr &msg) |
| |
| void | execute_step (int index_mvt_step, int index_partial_movement) |
| |
| std::string | get_subscriber_topic () |
| |
| | MovementPublisher (std::string joint_name, double rate=100.0, unsigned int repetition=1, unsigned int nb_mvt_step=1000, std::string controller_type="", bool testing=false, HandCommander *hand_commander=NULL) |
| |
| | MovementPublisher (double min_value=0.0, double max_value=1.5, double rate=100.0, unsigned int repetition=1, unsigned int nb_mvt_step=1000, std::string controller_type="") |
| |
| void | set_publisher (ros::Publisher publisher) |
| |
| void | set_subscriber (ros::Subscriber subscriber) |
| |
| void | sr_calculateErrorCallback (const sr_robot_msgs::JointControllerState::ConstPtr &msg) |
| |
| void | start () |
| |
| void | stop () |
| |
| virtual | ~MovementPublisher () |
| |
Definition at line 44 of file movement_publisher.hpp.
◆ MovementPublisher() [1/2]
| shadowrobot::MovementPublisher::MovementPublisher |
( |
std::string |
joint_name, |
|
|
double |
rate = 100.0, |
|
|
unsigned int |
repetition = 1, |
|
|
unsigned int |
nb_mvt_step = 1000, |
|
|
std::string |
controller_type = "", |
|
|
bool |
testing = false, |
|
|
HandCommander * |
hand_commander = NULL |
|
) |
| |
This is the constructor used when providing a joint name. It automatically extracts the min and max + subscriber / publishers from the HandCommander.
- Parameters
-
| joint_name | the name of the joint we want to move. |
| rate | rate at which the targets should be published. |
| repetition | number of times the movement should be repeated |
| nb_mvt_step | number of steps we take in the image |
| controller_type | the type of controller ("sr" or "ros") |
| testing | set to true when running a gazebo test (just adds a long sleep). |
| hand_commander | helper for controlling the shadow hand |
Definition at line 37 of file movement_publisher.cpp.
◆ MovementPublisher() [2/2]
| shadowrobot::MovementPublisher::MovementPublisher |
( |
double |
min_value = 0.0, |
|
|
double |
max_value = 1.5, |
|
|
double |
rate = 100.0, |
|
|
unsigned int |
repetition = 1, |
|
|
unsigned int |
nb_mvt_step = 1000, |
|
|
std::string |
controller_type = "" |
|
) |
| |
◆ ~MovementPublisher()
| shadowrobot::MovementPublisher::~MovementPublisher |
( |
| ) |
|
|
virtual |
◆ add_movement()
◆ calculateErrorCallback()
| void shadowrobot::MovementPublisher::calculateErrorCallback |
( |
const control_msgs::JointControllerState::ConstPtr & |
msg | ) |
|
Used to listen to a control_msgs::JointControllerState and calculate the mean square error of every movement repetition
- Parameters
-
| msg | the current state of the controller. |
Definition at line 163 of file movement_publisher.cpp.
◆ execute_step()
| void shadowrobot::MovementPublisher::execute_step |
( |
int |
index_mvt_step, |
|
|
int |
index_partial_movement |
|
) |
| |
◆ get_subscriber_topic()
| std::string shadowrobot::MovementPublisher::get_subscriber_topic |
( |
| ) |
|
◆ publish_()
| void shadowrobot::MovementPublisher::publish_ |
( |
| ) |
|
|
protected |
Publishes the message, using either the HandCommander (recommended) or the previous approach, using directly a remapped publisher.
Definition at line 198 of file movement_publisher.cpp.
◆ set_publisher()
| void shadowrobot::MovementPublisher::set_publisher |
( |
ros::Publisher |
publisher | ) |
|
◆ set_subscriber()
| void shadowrobot::MovementPublisher::set_subscriber |
( |
ros::Subscriber |
subscriber | ) |
|
◆ sr_calculateErrorCallback()
| void shadowrobot::MovementPublisher::sr_calculateErrorCallback |
( |
const sr_robot_msgs::JointControllerState::ConstPtr & |
msg | ) |
|
Used to listen to a sr_robot_msgs::JointControllerState and calculate the mean square error of every movement repetition
- Parameters
-
| msg | the current state of the controller. |
Definition at line 151 of file movement_publisher.cpp.
◆ start()
| void shadowrobot::MovementPublisher::start |
( |
| ) |
|
◆ stop()
| void shadowrobot::MovementPublisher::stop |
( |
| ) |
|
◆ subscribe_and_default_pub_()
| void shadowrobot::MovementPublisher::subscribe_and_default_pub_ |
( |
std::string |
input | ) |
|
|
protected |
Subscribes with the correct type (based on controller_type_) to the given topic. Also initialises the MSE publisher.
- Parameters
-
| input | Topic to which we're subscribing. |
Definition at line 82 of file movement_publisher.cpp.
◆ controller_type
| std::string shadowrobot::MovementPublisher::controller_type |
|
protected |
◆ hand_commander_
◆ joint_name_
| std::string shadowrobot::MovementPublisher::joint_name_ |
|
protected |
◆ joint_vector_
| std::vector<sr_robot_msgs::joint> shadowrobot::MovementPublisher::joint_vector_ |
|
protected |
◆ last_target_
| double shadowrobot::MovementPublisher::last_target_ |
|
protected |
◆ max
| double shadowrobot::MovementPublisher::max |
|
protected |
◆ min
| double shadowrobot::MovementPublisher::min |
|
protected |
◆ MSError_
| double shadowrobot::MovementPublisher::MSError_ |
|
protected |
◆ msg
| std_msgs::Float64 shadowrobot::MovementPublisher::msg |
|
protected |
◆ n_samples_
| unsigned int shadowrobot::MovementPublisher::n_samples_ |
|
protected |
◆ nb_mvt_step
| unsigned int shadowrobot::MovementPublisher::nb_mvt_step |
|
protected |
◆ nh_tilde
◆ partial_movements
| std::vector<PartialMovement> shadowrobot::MovementPublisher::partial_movements |
|
protected |
◆ pub
◆ pub_mse_
◆ publishing_rate
| ros::Rate shadowrobot::MovementPublisher::publishing_rate |
|
protected |
◆ repetition
| unsigned int shadowrobot::MovementPublisher::repetition |
|
protected |
◆ SError_
| double shadowrobot::MovementPublisher::SError_ |
|
protected |
◆ sub_
The documentation for this class was generated from the following files: