KaCanOpen
 All Classes Functions Variables Typedefs Enumerations Pages
Public Member Functions | List of all members
kaco::JointStatePublisher Class Reference

This class provides a Publisher implementation for use with kaco::Bridge and a CiA 402 motor device. It publishes the motor state as JointState messages from the ROS common_messages package. More...

#include <joint_state_publisher.h>

Inheritance diagram for kaco::JointStatePublisher:
Inheritance graph
[legend]
Collaboration diagram for kaco::JointStatePublisher:
Collaboration graph
[legend]

Public Member Functions

 JointStatePublisher (Device &device, int32_t position_0_degree, int32_t position_360_degree, const std::string &position_actual_field="Position actual value", const std::string &topic_name="")
 Constructor. More...
 
void advertise () override
 
void publish () override
 

Detailed Description

This class provides a Publisher implementation for use with kaco::Bridge and a CiA 402 motor device. It publishes the motor state as JointState messages from the ROS common_messages package.

Currenty, only the motor angle is published. You have to initialize the motor on your own. The motor is expected to be in position mode.

Definition at line 51 of file joint_state_publisher.h.

Constructor & Destructor Documentation

kaco::JointStatePublisher::JointStatePublisher ( Device device,
int32_t  position_0_degree,
int32_t  position_360_degree,
const std::string &  position_actual_field = "Position actual value",
const std::string &  topic_name = "" 
)

Constructor.

Parameters
devicea CiA 402 compliant motor device object
position_0_degreeThe motor position (dictionary entry "Position actual value") which represents a 0 degree angle.
position_360_degreeLike position_0_degree for 360 degree state.
position_actual_fieldName of the dictionary entry to use.
topic_nameCustom topic name. Leave out for default.
Exceptions
std::runtime_errorif device is not CiA 402 compliant and in position_mode.

Definition at line 46 of file joint_state_publisher.cpp.

Member Function Documentation

void kaco::JointStatePublisher::advertise ( )
overridevirtual
See also
interface Publisher

Implements kaco::Publisher.

Definition at line 76 of file joint_state_publisher.cpp.

void kaco::JointStatePublisher::publish ( )
overridevirtual
See also
interface Publisher

Implements kaco::Publisher.

Definition at line 86 of file joint_state_publisher.cpp.


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