IRI ROS Specific Driver Class. More...
#include <dynamixel_gripper_driver.h>
Public Types | |
typedef iri_dynamixel_gripper::DynamixelGripperConfig | Config |
define config type | |
Public Member Functions | |
bool | close_gripper () |
gripper will perform a closing action (pick) | |
bool | closeDriver (void) |
close driver | |
void | config_update (Config &new_cfg, uint32_t level=0) |
config update | |
DynamixelGripperDriver (void) | |
constructor | |
float | get_angle () |
return current angle position of the motor | |
float | get_effort () |
return the current motor effort | |
float | get_max_effort () |
return the max effort supported by the motor | |
bool | is_moving () |
return if the gripper is currently moving | |
bool | open_gripper () |
gripper will perform an opening action (lift) | |
bool | openDriver (void) |
open driver | |
bool | startDriver (void) |
start driver | |
void | stop_gripper () |
ask gripper to stops its motion | |
bool | stopDriver (void) |
stop driver | |
~DynamixelGripperDriver (void) | |
Destructor. | |
Public Attributes | |
Config | config_ |
config variable | |
Private Member Functions | |
bool | move_gripper (const double position_in_radians) |
internal function to perfemor gripper movement | |
Private Attributes | |
int | baudrate_ |
int | bus_id_ |
bool | closed_ |
double | effort_ |
double | max_angle_ |
double | min_angle_ |
boost::shared_ptr < CDynamixelMotor > | motor_ |
unsigned char | servo_id_ |
IRI ROS Specific Driver Class.
This class inherits from the IRI Base class IriBaseDriver, which provides the guidelines to implement any specific driver. The IriBaseDriver class offers an easy framework to integrate functional drivers implemented in C++ with the ROS driver structure. ROS driver_base state transitions are already managed by IriBaseDriver.
The DynamixelGripperDriver class must implement all specific driver requirements to safetely open, close, run and stop the driver at any time. It also must guarantee an accessible interface for all driver's parameters.
The DynamixelGripperConfig.cfg needs to be filled up with those parameters suitable to be changed dynamically by the ROS dyanmic reconfigure application. The implementation of the CIriNode class will manage those parameters through methods like postNodeOpenHook() and reconfigureNodeHook().
Definition at line 52 of file dynamixel_gripper_driver.h.
typedef iri_dynamixel_gripper::DynamixelGripperConfig DynamixelGripperDriver::Config |
define config type
Define a Config type with the DynamixelGripperConfig. All driver implementations will then use the same variable type Config.
Definition at line 72 of file dynamixel_gripper_driver.h.
constructor
In this constructor parameters related to the specific driver can be initalized. Those parameters can be also set in the openDriver() function. Attributes from the main node driver class IriBaseDriver such as loop_rate, may be also overload here.
Definition at line 3 of file dynamixel_gripper_driver.cpp.
Destructor.
This destructor is called when the object is about to be destroyed.
Definition at line 199 of file dynamixel_gripper_driver.cpp.
gripper will perform a closing action (pick)
Definition at line 113 of file dynamixel_gripper_driver.cpp.
bool DynamixelGripperDriver::closeDriver | ( | void | ) | [virtual] |
close driver
In this function, the driver must be closed. Variables related to the driver state must also be taken into account. This function is automatically called by IriBaseDriver::doClose(), an state transition is performed if return value equals true.
Implements iri_base_driver::IriBaseDriver.
Definition at line 44 of file dynamixel_gripper_driver.cpp.
void DynamixelGripperDriver::config_update | ( | Config & | new_cfg, |
uint32_t | level = 0 |
||
) |
config update
In this function the driver parameters must be updated with the input config variable. Then the new configuration state will be stored in the Config attribute.
new_cfg | the new driver configuration state |
level | level in which the update is taken place |
Definition at line 63 of file dynamixel_gripper_driver.cpp.
float DynamixelGripperDriver::get_angle | ( | ) |
return current angle position of the motor
Definition at line 157 of file dynamixel_gripper_driver.cpp.
float DynamixelGripperDriver::get_effort | ( | ) |
return the current motor effort
Definition at line 142 of file dynamixel_gripper_driver.cpp.
float DynamixelGripperDriver::get_max_effort | ( | void | ) |
return the max effort supported by the motor
Definition at line 151 of file dynamixel_gripper_driver.cpp.
return if the gripper is currently moving
Definition at line 126 of file dynamixel_gripper_driver.cpp.
bool DynamixelGripperDriver::move_gripper | ( | const double | position_in_radians | ) | [private] |
internal function to perfemor gripper movement
Definition at line 166 of file dynamixel_gripper_driver.cpp.
gripper will perform an opening action (lift)
Definition at line 107 of file dynamixel_gripper_driver.cpp.
bool DynamixelGripperDriver::openDriver | ( | void | ) | [virtual] |
open driver
In this function, the driver must be openned. Openning errors must be taken into account. This function is automatically called by IriBaseDriver::doOpen(), an state transition is performed if return value equals true.
Implements iri_base_driver::IriBaseDriver.
Definition at line 15 of file dynamixel_gripper_driver.cpp.
bool DynamixelGripperDriver::startDriver | ( | void | ) | [virtual] |
start driver
After this function, the driver and its thread will be started. The driver and related variables should be properly setup. This function is automatically called by IriBaseDriver::doStart(), an state transition is performed if return value equals true.
Implements iri_base_driver::IriBaseDriver.
Definition at line 51 of file dynamixel_gripper_driver.cpp.
void DynamixelGripperDriver::stop_gripper | ( | ) |
ask gripper to stops its motion
Definition at line 119 of file dynamixel_gripper_driver.cpp.
bool DynamixelGripperDriver::stopDriver | ( | void | ) | [virtual] |
stop driver
After this function, the driver's thread will stop its execution. The driver and related variables should be properly setup. This function is automatically called by IriBaseDriver::doStop(), an state transition is performed if return value equals true.
Implements iri_base_driver::IriBaseDriver.
Definition at line 57 of file dynamixel_gripper_driver.cpp.
int DynamixelGripperDriver::baudrate_ [private] |
Definition at line 57 of file dynamixel_gripper_driver.h.
int DynamixelGripperDriver::bus_id_ [private] |
Definition at line 58 of file dynamixel_gripper_driver.h.
bool DynamixelGripperDriver::closed_ [private] |
Definition at line 63 of file dynamixel_gripper_driver.h.
config variable
This variable has all the driver parameters defined in the cfg config file. Is updated everytime function config_update() is called.
Definition at line 80 of file dynamixel_gripper_driver.h.
double DynamixelGripperDriver::effort_ [private] |
Definition at line 62 of file dynamixel_gripper_driver.h.
double DynamixelGripperDriver::max_angle_ [private] |
Definition at line 60 of file dynamixel_gripper_driver.h.
double DynamixelGripperDriver::min_angle_ [private] |
Definition at line 61 of file dynamixel_gripper_driver.h.
boost::shared_ptr<CDynamixelMotor> DynamixelGripperDriver::motor_ [private] |
Definition at line 55 of file dynamixel_gripper_driver.h.
unsigned char DynamixelGripperDriver::servo_id_ [private] |
Definition at line 59 of file dynamixel_gripper_driver.h.