Public Member Functions | Public Attributes | Protected Attributes
generic_updater::GenericUpdater Class Reference

#include <generic_updater.hpp>

Inheritance diagram for generic_updater::GenericUpdater:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual
operation_mode::device_update_state::DeviceUpdateState 
build_command (ETHERCAT_DATA_STRUCTURE_0200_PALM_EDC_COMMAND *command)=0
 GenericUpdater (std::vector< UpdateConfig > update_configs_vector, operation_mode::device_update_state::DeviceUpdateState update_state)
void timer_callback (const ros::TimerEvent &event, FROM_MOTOR_DATA_TYPE data_type)
 ~GenericUpdater ()

Public Attributes

std::vector< UpdateConfiginitialization_configs_vector
 Contains all the initialization data types.
operation_mode::device_update_state::DeviceUpdateState update_state

Protected Attributes

std::vector< UpdateConfigimportant_update_configs_vector
 Contains all the important data types.
boost::shared_ptr< boost::mutex > mutex
ros::NodeHandle nh_tilde
std::vector< ros::Timertimers
 All the timers for the unimportant data types.
std::queue< int32u, std::list
< int32u > > 
unimportant_data_queue
 A queue containing the unimportant data types we want to ask for next time (empty most of the time).
std::vector< UpdateConfigupdate_configs_vector
 Contains the vector with the update configs for every command. We store it to be able to reinitialize.
int which_data_to_request
 iterate through the important or initialization data types.

Detailed Description

The Generic Updater builds the next command we want to send to the hand. We can ask for different types of data at different rates. The data and their rates are defined in the sr_ethercat_hand_config/rates/xxxxx.yaml The important data are refreshed as often as possible (they have a -1. refresh rate in the config file).

The unimportant data are refreshed at their given rate (the value is defined in the config in seconds).

Definition at line 74 of file generic_updater.hpp.


Constructor & Destructor Documentation

Definition at line 35 of file generic_updater.cpp.

Definition at line 73 of file generic_updater.cpp.


Member Function Documentation

virtual operation_mode::device_update_state::DeviceUpdateState generic_updater::GenericUpdater::build_command ( ETHERCAT_DATA_STRUCTURE_0200_PALM_EDC_COMMAND *  command) [pure virtual]

Building the motor command. This function is called at each packCommand() call. If an unimportant data is waiting then we send it, otherwise, we send the next important data.

Parameters:
commandThe command which will be sent to the motor.
Returns:
the current state of the device.

Implemented in generic_updater::SensorUpdater, and generic_updater::MotorUpdater.

A timer callback for the unimportant data. The frequency of this callback is defined in the config file.

Parameters:
event
data_typeThe unimportant data type we want to ask for.

Reimplemented in generic_updater::SensorUpdater, and generic_updater::MotorUpdater.

Definition at line 77 of file generic_updater.cpp.


Member Data Documentation

Contains all the important data types.

Definition at line 107 of file generic_updater.hpp.

Contains all the initialization data types.

Definition at line 101 of file generic_updater.hpp.

boost::shared_ptr<boost::mutex> generic_updater::GenericUpdater::mutex [protected]

Definition at line 118 of file generic_updater.hpp.

Definition at line 104 of file generic_updater.hpp.

All the timers for the unimportant data types.

Definition at line 112 of file generic_updater.hpp.

A queue containing the unimportant data types we want to ask for next time (empty most of the time).

Definition at line 114 of file generic_updater.hpp.

Contains the vector with the update configs for every command. We store it to be able to reinitialize.

Definition at line 116 of file generic_updater.hpp.

Definition at line 99 of file generic_updater.hpp.

iterate through the important or initialization data types.

Definition at line 109 of file generic_updater.hpp.


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


sr_robot_lib
Author(s): Ugo Cupcic / ugo@shadowrobot.com , software@shadowrobot.com
autogenerated on Thu Jan 2 2014 12:02:17