Skip to content
Snippets Groups Projects
Commit 8addb6db authored by Joan Perez Ibarz's avatar Joan Perez Ibarz
Browse files

Adding iri_common_msgs package into the iri_common_drivers stack

Updating iri_base_driver 
parent b34687fd
No related branches found
No related tags found
No related merge requests found
......@@ -19,17 +19,17 @@ set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
# edit the following line to add all the source code files of the library
#SET(sources ./src/iri_base_driver.cpp)
SET(sources ./src/iri_base_driver.cpp)
# edit the following line to add all the header files of the library
#SET(headers ./include/iri_base_driver.h ./include/iri_base_driver_node.h)
SET(headers ./include/iri_base_driver.h ./include/iri_base_driver_node.h)
#FIND_PACKAGE(iriutils REQUIRED)
FIND_PACKAGE(iriutils REQUIRED)
#INCLUDE_DIRECTORIES(${iriutils_INCLUDE_DIR} ${headers})
#INCLUDE_DIRECTORIES(${iriutils_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${iriutils_INCLUDE_DIR} ${headers})
INCLUDE_DIRECTORIES(${iriutils_INCLUDE_DIR})
#common commands for building c++ executables and libraries
#rosbuild_add_library(${PROJECT_NAME} SHARED ${sources})
rosbuild_add_library(${PROJECT_NAME} SHARED ${sources})
#target_link_libraries(${PROJECT_NAME} another_library)
#rosbuild_add_boost_directories()
#rosbuild_link_boost(${PROJECT_NAME} thread)
......
......@@ -30,22 +30,24 @@
/**
* \brief IRI ROS Base Driver Class
*
* This class inherits from the ROS class driver_base::Driver, which provides the
* guidelines for any driver kind. The IriBaseDriver class offers an easy framework
* to integrate functional drivers implemented in C++ with the ROS driver structure.
* A shared library is generated together with CIriNode class to force implementation
* of virtual methods to final user. Common use functions to open, close, start
* and stop a driver need to be filled up when instantiating this class. ROS
* provides state transition methods to change from one state to another.
* This class inherits from the ROS class driver_base::Driver, which provides
* the guidelines for any driver kind. The IriBaseDriver class offers an easy
* framework to integrate functional drivers implemented in C++ with the ROS
* driver structure. A shared library is generated together with IriBaseNodeDriver
* class to force implementation of virtual methods to final user. Common use
* functions to open, close, start and stop a driver need to be filled up when
* instantiating this class. ROS provides state transition methods to change
* from one state to another.
*
* This class is used as an intermediate level between ROS basic classes and the
* user final driver implementation. Methods to manage drivers are implemented to
* provide common features to all driver-type objects. New methods are provided
* to the user for the specific driver needs.
* user final driver implementation. Methods to manage drivers are implemented
* to provide common features to all driver-type objects. New methods are
* provided to the user for the specific driver needs.
*
* Instances of both IriBaseDriver and CIriNode can be easly generated with the
* iri_ros_scripts package. Similarly, data can be sent and read through ROS topics
* by using those scripts. The scripts can be downloaded from the iri_stack SVN.
* Instances of both IriBaseDriver and IriBaseNodeDriver can be easly generated
* with the iri_ros_scripts package. Similarly, data can be sent and read
* through ROS topics by using those scripts. The scripts can be downloaded
* from the iri_stack SVN.
*/
class IriBaseDriver : public driver_base::Driver
{
......
......@@ -36,30 +36,30 @@
*
* This class inherits from the ROS class driver_base::DriverNode<TemplateDriver>
* to provide an execution thread to the driver object. The TemplateDriver object
* must be an implementation of the CIriDriver class. The inherit template design
* form allows complete access to the driver object while manteining flexibility
* to instantiate any object inherit from CIriDriver.
* must be an implementation of the IriBaseDriver class. The inherit template
* design form allows complete access to the driver object while manteining
* flexibility to instantiate any object inherit from IriBaseDriver.
*
* A shared library is generated together with CIriDriver class to force
* A shared library is generated together with IriBaseDriver class to force
* implementation of virtual methods to final user. Functions from ROS driver
* base class to perform tests, add diagnostics or hooks, are mainteined to
* implement common purpose behaviours and forwarded to the final user node class
* for specification.
* implement common purpose behaviours and forwarded to the final user node
* class for specification.
*
* Threads are implemented using iri_utils software utilities. The mainThread()
* function loops in a defined loop_rate_. In each iteration, the abstract
* mainNodeThread() function defined in the inherit node class is called.
*
* Similarly, functions such as addDiagnostics() or addRunningTests() are prepared
* for detailing common features for all driver nodes while executing specific
* commands for each specification by calling the respective functions
* Similarly, functions such as addDiagnostics() or addRunningTests() are
* prepared for detailing common features for all driver nodes while executing
* specific commands for each specification by calling the respective functions
* addNodeDiagnostics() and addNodeRunningTests() from the inherit node
* implementation.
*
* Instances of both CIriDriver and IriBaseNodeDriver can be easly generated with the
* iri_ros_scripts package. Similarly, data can be sent and read through ROS
* topics by using those scripts. The scripts can be downloaded from the
* iri_stack SVN.
* Instances of both IriBaseDriver and IriBaseNodeDriver can be easly generated
* with the iri_ros_scripts package. Similarly, data can be sent and read
* through ROS topics by using those scripts. The scripts can be downloaded
* from the iri_stack SVN.
*/
template <class Driver>
class IriBaseNodeDriver : public driver_base::DriverNode<Driver>
......@@ -70,17 +70,17 @@ class IriBaseNodeDriver : public driver_base::DriverNode<Driver>
*
* This reference to the unique thread handler is initialized when an object
* of this class is first created. It is used to create and handle all the
* IriBaseNodeDriver threads. The object pointed by this reference is shared by all
* objects in any application.
* IriBaseNodeDriver threads. The object pointed by this reference is shared
* by all objects in any application.
*/
CThreadServer *thread_server_;
/**
* \brief identifier of the node main thread
*
* This string has the identifier of the main IriBaseNodeDriver thread. This string
* is initialized at contruction time. This thread is only used internally to
* the class, so it is not possible to get its identifier out.
* This string has the identifier of the main IriBaseNodeDriver thread. This
* string is initialized at contruction time. This thread is only used
* internally to the class, so it is not possible to get its identifier out.
*/
std::string main_thread_id_;
......@@ -220,7 +220,7 @@ class IriBaseNodeDriver : public driver_base::DriverNode<Driver>
*
* Loop frequency can be tuned my modifying loop_rate_ attribute.
*
* \param param is a pointer to a CIriDriver object class. It is used to
* \param param is a pointer to a IriBaseDriver object class. It is used to
* access to the object attributes and methods.
*/
static void *mainThread(void *param);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment