#include <wam_controller_driver.h>
Public Types | |
typedef iri_wam_controller::WamControllerConfig | Config |
define config type | |
Public Member Functions | |
bool | closeDriver (void) |
close driver | |
void | config_update (Config &new_cfg, uint32_t level=0) |
config update | |
trajectory_msgs::JointTrajectoryPoint | get_desired_joint_trajectory_point () |
Returns the current desired joint trajectory point. | |
void | get_joint_angles (std::vector< double > *angles) |
size_t | get_num_joints () |
void | get_pose (std::vector< double > *pose) |
std::string | get_robot_name () |
void | hold_off () |
void | hold_on () |
bool | is_joint_trajectory_result_succeeded () |
bool | is_joints_move_request_valid (const std::vector< double > &angles) |
bool | is_moving () |
check if the wam is moving right now after a moveTo | |
bool | is_moving_trajectory () |
void | move_in_joints (std::vector< double > *angles, std::vector< double > *vels=NULL, std::vector< double > *accs=NULL) |
void | move_trajectory_in_joints (const trajectory_msgs::JointTrajectory &trajectory) |
Ask the low level driver to perform a trajectory in joints. | |
bool | openDriver (void) |
open driver | |
bool | startDriver (void) |
start driver | |
void | stop_trajectory_in_joints () |
bool | stopDriver (void) |
stop driver | |
void | wait_move_end () |
WamControllerDriver (void) | |
constructor | |
~WamControllerDriver (void) | |
Destructor. | |
Public Attributes | |
Config | config_ |
config variable | |
Private Attributes | |
trajectory_msgs::JointTrajectoryPoint | desired_joint_trajectory_point_ |
std::string | robot_name_ |
Robot name is needed to name the robot links. | |
wamDriver * | wam_ |
The low level robot. |
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 WamControllerDriver 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 WamControllerConfig.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 57 of file wam_controller_driver.h.
typedef iri_wam_controller::WamControllerConfig WamControllerDriver::Config |
define config type
Define a Config type with the WamControllerConfig. All driver implementations will then use the same variable type Config.
Definition at line 71 of file wam_controller_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 wam_controller_driver.cpp.
Destructor.
This destructor is called when the object is about to be destroyed.
Definition at line 110 of file wam_controller_driver.cpp.
bool WamControllerDriver::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 48 of file wam_controller_driver.cpp.
void WamControllerDriver::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 86 of file wam_controller_driver.cpp.
trajectory_msgs::JointTrajectoryPoint WamControllerDriver::get_desired_joint_trajectory_point | ( | ) |
Returns the current desired joint trajectory point.
Definition at line 189 of file wam_controller_driver.cpp.
void WamControllerDriver::get_joint_angles | ( | std::vector< double > * | angles | ) |
Definition at line 142 of file wam_controller_driver.cpp.
size_t WamControllerDriver::get_num_joints | ( | ) | [inline] |
Definition at line 168 of file wam_controller_driver.h.
void WamControllerDriver::get_pose | ( | std::vector< double > * | pose | ) |
Definition at line 136 of file wam_controller_driver.cpp.
std::string WamControllerDriver::get_robot_name | ( | ) |
Definition at line 148 of file wam_controller_driver.cpp.
void WamControllerDriver::hold_off | ( | ) |
Definition at line 317 of file wam_controller_driver.cpp.
void WamControllerDriver::hold_on | ( | ) |
Definition at line 308 of file wam_controller_driver.cpp.
Definition at line 175 of file wam_controller_driver.cpp.
bool WamControllerDriver::is_joints_move_request_valid | ( | const std::vector< double > & | angles | ) |
Checks if the lenght of the vector is correct and if NaN are present
Definition at line 114 of file wam_controller_driver.cpp.
check if the wam is moving right now after a moveTo
Definition at line 165 of file wam_controller_driver.cpp.
after a /move_trajectory_in_joints
Definition at line 155 of file wam_controller_driver.cpp.
void WamControllerDriver::move_in_joints | ( | std::vector< double > * | angles, |
std::vector< double > * | vels = NULL , |
||
std::vector< double > * | accs = NULL |
||
) |
Definition at line 270 of file wam_controller_driver.cpp.
void WamControllerDriver::move_trajectory_in_joints | ( | const trajectory_msgs::JointTrajectory & | trajectory | ) |
Ask the low level driver to perform a trajectory in joints.
@ trajectory: list of joints, can include only position or positions/velocities/accelerations
Definition at line 195 of file wam_controller_driver.cpp.
bool WamControllerDriver::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 22 of file wam_controller_driver.cpp.
bool WamControllerDriver::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 57 of file wam_controller_driver.cpp.
Definition at line 264 of file wam_controller_driver.cpp.
bool WamControllerDriver::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 78 of file wam_controller_driver.cpp.
void WamControllerDriver::wait_move_end | ( | ) |
Definition at line 299 of file wam_controller_driver.cpp.
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 79 of file wam_controller_driver.h.
trajectory_msgs::JointTrajectoryPoint WamControllerDriver::desired_joint_trajectory_point_ [private] |
Definition at line 63 of file wam_controller_driver.h.
std::string WamControllerDriver::robot_name_ [private] |
Robot name is needed to name the robot links.
Definition at line 61 of file wam_controller_driver.h.
wamDriver* WamControllerDriver::wam_ [private] |
The low level robot.
Definition at line 62 of file wam_controller_driver.h.