Message handler that relays joint positions (converts simple message types to ROS message types and publishes them) More...
#include <joint_feedback_relay_handler.h>
Public Member Functions | |
virtual bool | init (SmplMsgConnection *connection, std::vector< std::string > &joint_names) |
Class initializer. More... | |
virtual bool | init (SmplMsgConnection *connection, std::map< int, RobotGroup > &robot_groups) |
Class initializer. More... | |
JointFeedbackRelayHandler (int robot_id=-1) | |
Constructor. More... | |
Public Member Functions inherited from industrial_robot_client::joint_relay_handler::JointRelayHandler | |
bool | init (industrial::smpl_msg_connection::SmplMsgConnection *connection, std::vector< std::string > &joint_names) |
JointRelayHandler () | |
JointRelayHandler () | |
Constructor. More... | |
Protected Member Functions | |
virtual bool | convert_message (SimpleMessage &msg_in, JointTrajectoryPoint *joint_state) |
Convert joint message into intermediate message-type. More... | |
virtual bool | convert_message (SimpleMessage &msg_in, DynamicJointsGroup *joint_state, int robot_id) |
Convert joint message into intermediate message-type. More... | |
bool | create_messages (SimpleMessage &msg_in, control_msgs::FollowJointTrajectoryFeedback *control_state, sensor_msgs::JointState *sensor_state) |
Convert joint message into publish message-types. More... | |
bool | create_messages (SimpleMessage &msg_in, control_msgs::FollowJointTrajectoryFeedback *control_state, sensor_msgs::JointState *sensor_state, int robot_id) |
Convert joint message into publish message-types. More... | |
virtual bool | select (const DynamicJointsGroup &all_joint_state, const std::vector< std::string > &all_joint_names, DynamicJointsGroup *pub_joint_state, std::vector< std::string > *pub_joint_names) |
virtual bool | transform (const DynamicJointsGroup &state_in, DynamicJointsGroup *state_out) |
Transform joint state before publishing. Can be overridden to implement, e.g. robot-specific joint coupling. More... | |
Protected Member Functions inherited from industrial_robot_client::joint_relay_handler::JointRelayHandler | |
virtual bool | create_messages (JointMessage &msg_in, control_msgs::FollowJointTrajectoryFeedback *control_state, sensor_msgs::JointState *sensor_state) |
virtual bool | init (industrial::smpl_msg_connection::SmplMsgConnection *connection, int msg_type, std::vector< std::string > &joint_names) |
Class initializer. More... | |
virtual bool | init (industrial::smpl_msg_connection::SmplMsgConnection *connection, int msg_type, std::map< int, RobotGroup > &robot_groups) |
Class initializer. More... | |
bool | internalCB (JointMessage &in) |
bool | internalCB (SimpleMessage &in) |
Callback executed upon receiving a joint message. More... | |
virtual bool | select (const std::vector< double > &all_joint_pos, const std::vector< std::string > &all_joint_names, std::vector< double > *pub_joint_pos, std::vector< std::string > *pub_joint_names) |
virtual bool | select (const JointTrajectoryPoint &all_joint_state, const std::vector< std::string > &all_joint_names, JointTrajectoryPoint *pub_joint_state, std::vector< std::string > *pub_joint_names) |
Select specific joints for publishing. More... | |
virtual bool | transform (const std::vector< double > &pos_in, std::vector< double > *pos_out) |
virtual bool | transform (const JointTrajectoryPoint &state_in, JointTrajectoryPoint *state_out) |
Transform joint state before publishing. Can be overridden to implement, e.g. robot-specific joint coupling. More... | |
Protected Attributes | |
int | robot_id_ |
bool | version_0_ |
Protected Attributes inherited from industrial_robot_client::joint_relay_handler::JointRelayHandler | |
std::vector< std::string > | all_joint_names_ |
ros::NodeHandle | node_ |
std::map< int, ros::Publisher > | pub_controls_ |
ros::Publisher | pub_joint_control_state_ |
ros::Publisher | pub_joint_sensor_state_ |
std::map< int, ros::Publisher > | pub_states_ |
std::map< int, RobotGroup > | robot_groups_ |
Private Member Functions | |
bool | convert_message (JointFeedbackMessage &msg_in, JointTrajectoryPoint *joint_state) |
Convert joint feedback message into intermediate message-type. More... | |
bool | convert_message (JointFeedbackMessage &msg_in, DynamicJointsGroup *joint_state, int robot_id) |
Convert joint feedback message into intermediate message-type. More... | |
Static Private Member Functions | |
static bool | JointDataToVector (const industrial::joint_data::JointData &joints, std::vector< double > &vec, int len) |
Additional Inherited Members | |
Public Types inherited from industrial_robot_client::joint_relay_handler::JointRelayHandler | |
typedef std::map< int, RobotGroup >::iterator | it_type |
Message handler that relays joint positions (converts simple message types to ROS message types and publishes them)
THIS CLASS IS NOT THREAD-SAFE
Definition at line 62 of file joint_feedback_relay_handler.h.
|
inlineexplicit |
Constructor.
Definition at line 68 of file joint_feedback_relay_handler.h.
|
protectedvirtual |
Convert joint message into intermediate message-type.
[in] | msg_in | Message from robot connection |
[out] | joint_state | JointTrajectoryPt message for intermediate processing |
Reimplemented from industrial_robot_client::joint_relay_handler::JointRelayHandler.
Definition at line 147 of file joint_feedback_relay_handler.cpp.
|
protectedvirtual |
Convert joint message into intermediate message-type.
[in] | msg_in | Message from robot connection |
[out] | joint_state | JointTrajectoryPt message for intermediate processing |
Reimplemented from industrial_robot_client::joint_relay_handler::JointRelayHandler.
Definition at line 135 of file joint_feedback_relay_handler.cpp.
|
private |
Convert joint feedback message into intermediate message-type.
[in] | msg_in | JointFeedbackMessage from robot connection |
[out] | joint_state | JointTrajectoryPt message for intermediate processing |
Definition at line 228 of file joint_feedback_relay_handler.cpp.
|
private |
Convert joint feedback message into intermediate message-type.
[in] | msg_in | JointFeedbackMessage from robot connection |
[out] | joint_state | JointTrajectoryPt message for intermediate processing |
Definition at line 177 of file joint_feedback_relay_handler.cpp.
|
protectedvirtual |
Convert joint message into publish message-types.
[in] | msg_in | Message from robot connection |
[out] | control_state | FollowJointTrajectoryFeedback message for ROS publishing |
[out] | sensor_state | JointState message for ROS publishing |
Reimplemented from industrial_robot_client::joint_relay_handler::JointRelayHandler.
Definition at line 73 of file joint_feedback_relay_handler.cpp.
|
protectedvirtual |
Convert joint message into publish message-types.
[in] | msg_in | Message from robot connection |
[out] | control_state | FollowJointTrajectoryFeedback message for ROS publishing |
[out] | sensor_state | JointState message for ROS publishing |
Reimplemented from industrial_robot_client::joint_relay_handler::JointRelayHandler.
Definition at line 88 of file joint_feedback_relay_handler.cpp.
|
virtual |
Class initializer.
connection | simple message connection that will be used to send replies. |
joint_names | list of joint-names for msg-publishing.
|
Reimplemented from industrial_robot_client::joint_relay_handler::JointRelayHandler.
Definition at line 59 of file joint_feedback_relay_handler.cpp.
|
virtual |
Class initializer.
connection | simple message connection that will be used to send replies. |
joint_names | list of joint-names for msg-publishing.
|
Reimplemented from industrial_robot_client::joint_relay_handler::JointRelayHandler.
Definition at line 48 of file joint_feedback_relay_handler.cpp.
|
staticprivate |
Definition at line 159 of file joint_feedback_relay_handler.cpp.
|
protectedvirtual |
Reimplemented from industrial_robot_client::joint_relay_handler::JointRelayHandler.
Definition at line 279 of file joint_feedback_relay_handler.cpp.
|
inlineprotectedvirtual |
Transform joint state before publishing. Can be overridden to implement, e.g. robot-specific joint coupling.
[in] | state_in | joint state, exactly as passed from robot connection. |
[out] | state_out | transformed joint state (in same order/count as input state) |
Reimplemented from industrial_robot_client::joint_relay_handler::JointRelayHandler.
Definition at line 118 of file joint_feedback_relay_handler.h.
|
protected |
Definition at line 88 of file joint_feedback_relay_handler.h.
|
protected |
Definition at line 89 of file joint_feedback_relay_handler.h.