Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iri_base_driver
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
labrobotica
ros
iri_core
iri_base_driver
Commits
8addb6db
Commit
8addb6db
authored
14 years ago
by
Joan Perez Ibarz
Browse files
Options
Downloads
Patches
Plain Diff
Adding iri_common_msgs package into the iri_common_drivers stack
Updating iri_base_driver
parent
b34687fd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+6
-6
6 additions, 6 deletions
CMakeLists.txt
include/iri_base_driver/iri_base_driver.h
+15
-13
15 additions, 13 deletions
include/iri_base_driver/iri_base_driver.h
include/iri_base_driver/iri_base_driver_node.h
+19
-19
19 additions, 19 deletions
include/iri_base_driver/iri_base_driver_node.h
with
40 additions
and
38 deletions
CMakeLists.txt
+
6
−
6
View file @
8addb6db
...
...
@@ -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)
...
...
This diff is collapsed.
Click to expand it.
include/iri_base_driver/iri_base_driver.h
+
15
−
13
View file @
8addb6db
...
...
@@ -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
{
...
...
This diff is collapsed.
Click to expand it.
include/iri_base_driver/iri_base_driver_node.h
+
19
−
19
View file @
8addb6db
...
...
@@ -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
C
IriDriver class. The inherit template
design
* form allows complete access to the driver object while manteining
flexibility
* to instantiate any object inherit from
C
IriDriver.
* must be an implementation of the Iri
Base
Driver class. The inherit template
*
design
form allows complete access to the driver object while manteining
*
flexibility
to instantiate any object inherit from Iri
Base
Driver.
*
* A shared library is generated together with
C
IriDriver class to force
* A shared library is generated together with Iri
Base
Driver 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
C
IriDriver 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 Iri
Base
Driver 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
C
IriDriver object class. It is used to
* \param param is a pointer to a Iri
Base
Driver object class. It is used to
* access to the object attributes and methods.
*/
static
void
*
mainThread
(
void
*
param
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment