Public Member Functions | Private Member Functions | Private Attributes | List of all members
shadowrobot::SRPublisher Class Reference

#include <sr_publisher.h>

Public Member Functions

void publish ()
 
 SRPublisher (boost::shared_ptr< SRArticulatedRobot > sr_art_robot)
 
 ~SRPublisher ()
 Destructor. More...
 

Private Member Functions

double toRad (double deg)
 

Private Attributes

NodeHandle n_tilde
 
NodeHandle node
 ros node handle More...
 
Rate publish_rate
 the rate at which the data will be published. This can be set by a parameter in the launch file. More...
 
boost::shared_ptr< SRArticulatedRobotsr_articulated_robot
 The shadowhand object (can be either an object connected to the real robot or a virtual hand). More...
 
Publisher sr_jointstate_pos_pub
 The publisher which publishes the data to the \/{prefix}\/position\/joint_states topic. More...
 
Publisher sr_jointstate_target_pub
 The publisher which publishes the data to the \/{prefix}\/target\/joint_states topic. More...
 
Publisher sr_pub
 The publisher which publishes the data to the \/{prefix}\/shadowhand_data topic. More...
 

Detailed Description

This class publishes data concerning the shadowhand /shadowarm, like position, targets, forces, ... on different topics. To publish those data, just call the publish() function.

The data are published on three different topics. Two of them are joint_states topics (joint names, joint angles, joint velocities, joint efforts), which are then transformed into coordinates by two different robot_state_publisher (a ROS package). This is useful to visualize the data in rviz (part of ROS). A third topic is \/prefix\/shadowhand_data. The messages published on this last topic are better formatted for our hardware.

Definition at line 53 of file sr_publisher.h.

Constructor & Destructor Documentation

shadowrobot::SRPublisher::SRPublisher ( boost::shared_ptr< SRArticulatedRobot sr_art_robot)
explicit

Constructor initializing the ROS node, and setting the topic to which it publishes. The frequency at which this node will publish data is set by a parameter, read from ROS parameter server.

Parameters
sr_art_robotA Shadowhand or Shadowarm object, where the information to be published comes from.

Definition at line 50 of file sr_publisher.cpp.

shadowrobot::SRPublisher::~SRPublisher ( )

Destructor.

Definition at line 75 of file sr_publisher.cpp.

Member Function Documentation

void shadowrobot::SRPublisher::publish ( )

The callback method which is called at a given frequency. Gets the data from the shadowhand/shadowarm object.

Definition at line 84 of file sr_publisher.cpp.

double shadowrobot::SRPublisher::toRad ( double  deg)
inlineprivate

Convert an angle in degree to an angle in radians.

Parameters
degthe angle in degrees
Returns
the value in rads.

Definition at line 93 of file sr_publisher.h.

Member Data Documentation

NodeHandle shadowrobot::SRPublisher::n_tilde
private

Definition at line 74 of file sr_publisher.h.

NodeHandle shadowrobot::SRPublisher::node
private

ros node handle

Definition at line 74 of file sr_publisher.h.

Rate shadowrobot::SRPublisher::publish_rate
private

the rate at which the data will be published. This can be set by a parameter in the launch file.

Definition at line 76 of file sr_publisher.h.

boost::shared_ptr<SRArticulatedRobot> shadowrobot::SRPublisher::sr_articulated_robot
private

The shadowhand object (can be either an object connected to the real robot or a virtual hand).

Definition at line 79 of file sr_publisher.h.

Publisher shadowrobot::SRPublisher::sr_jointstate_pos_pub
private

The publisher which publishes the data to the \/{prefix}\/position\/joint_states topic.

Definition at line 82 of file sr_publisher.h.

Publisher shadowrobot::SRPublisher::sr_jointstate_target_pub
private

The publisher which publishes the data to the \/{prefix}\/target\/joint_states topic.

Definition at line 84 of file sr_publisher.h.

Publisher shadowrobot::SRPublisher::sr_pub
private

The publisher which publishes the data to the \/{prefix}\/shadowhand_data topic.

Definition at line 86 of file sr_publisher.h.


The documentation for this class was generated from the following files:


sr_hand
Author(s): Ugo Cupcic
autogenerated on Tue Oct 13 2020 03:55:53