Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iri_base_algorithm
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_algorithm
Commits
82238f81
"README.md" did not exist on "882d0aa868916ea6356e85630d4fd0c00ea33c49"
Commit
82238f81
authored
8 years ago
by
Sergi Hernandez
Browse files
Options
Downloads
Plain Diff
merge from iri_base_algorithm3
parents
7fca9fc2
dcaedf54
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+1
-3
1 addition, 3 deletions
CMakeLists.txt
include/iri_base_algorithm/iri_base_algorithm.h
+14
-37
14 additions, 37 deletions
include/iri_base_algorithm/iri_base_algorithm.h
manifest.xml
+2
-2
2 additions, 2 deletions
manifest.xml
with
17 additions
and
42 deletions
CMakeLists.txt
+
1
−
3
View file @
82238f81
...
...
@@ -23,9 +23,7 @@ set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
# edit the following line to add all the header files of the library
# SET(headers ./include/iri_base_algorithm.h)
# FIND_PACKAGE(iriutils REQUIRED)
# INCLUDE_DIRECTORIES(${iriutils_INCLUDE_DIR} ${headers})
# INCLUDE_DIRECTORIES(${headers})
#common commands for building c++ executables and libraries
# rosbuild_add_library(${PROJECT_NAME} SHARED ${sources})
...
...
This diff is collapsed.
Click to expand it.
include/iri_base_algorithm/iri_base_algorithm.h
+
14
−
37
View file @
82238f81
...
...
@@ -22,11 +22,6 @@
#include
<ros/ros.h>
#include
<signal.h>
// iri-utils thread server
#include
"threadserver.h"
#include
"exceptions.h"
#include
"mutex.h"
// boost thread includes for ROS::spin thread
#include
<boost/thread.hpp>
#include
<boost/bind.hpp>
...
...
@@ -98,24 +93,15 @@ class IriBaseAlgorithm : public AbstractAlgorithmNode
typedef
typename
Algorithm
::
Config
Config
;
protected:
/**
* \brief Reference to the unique thread handler
*
* 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.
*/
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.
*/
std
::
string
main_thread_id_
;
/**
* \brief Thread information structure
*
* This structure hold system level information of the thread and it is
* initialized when the thread is first created. This information can not
* be modified at any time and it is not accessible from outside the class.
*
*/
pthread_t
thread
;
/**
* \brief template algorithm class
...
...
@@ -299,15 +285,6 @@ IriBaseAlgorithm<Algorithm>::IriBaseAlgorithm() :
dsrv_
(
private_node_handle_
)
{
ROS_DEBUG
(
"IriBaseAlgorithm::Constructor"
);
// create thread server instance
this
->
thread_server_
=
CThreadServer
::
instance
();
// identify main thread
this
->
main_thread_id_
=
"main_thread"
;
// create main thread and attach to server
this
->
thread_server_
->
create_thread
(
this
->
main_thread_id_
);
this
->
thread_server_
->
attach_thread
(
this
->
main_thread_id_
,
this
->
mainThread
,
this
);
// // assign callback to dynamic reconfigure server
// dsrv_.setCallback(boost::bind(&IriBaseAlgorithm<Algorithm>::reconfigureCallback, this, _1, _2));
...
...
@@ -318,8 +295,8 @@ template <class Algorithm>
IriBaseAlgorithm
<
Algorithm
>::~
IriBaseAlgorithm
()
{
ROS_DEBUG
(
"IriBaseAlgorithm::Destructor"
);
this
->
thread_
server_
->
kill_thread
(
this
->
main_
thread
_id_
);
pthread_cancel
(
this
->
thread
);
p
thread_
join
(
this
->
thread
,
NULL
);
}
template
<
class
Algorithm
>
...
...
@@ -374,9 +351,9 @@ int IriBaseAlgorithm<Algorithm>::spin(void)
// assign callback to dynamic reconfigure server
this
->
dsrv_
.
setCallback
(
boost
::
bind
(
&
IriBaseAlgorithm
<
Algorithm
>::
reconfigureCallback
,
this
,
_1
,
_2
));
//
launch node
thread
this
->
thread_
server_
->
start_thread
(
this
->
main
_t
hread
_id_
);
//
create the status
thread
p
thread_
create
(
&
this
->
thread
,
NULL
,
this
->
main
T
hread
,
this
);
while
(
ros
::
ok
()
&&
!
ctrl_c_hit_count_
)
{
// update diagnostics
...
...
This diff is collapsed.
Click to expand it.
manifest.xml
+
2
−
2
View file @
82238f81
...
...
@@ -4,8 +4,8 @@
iri_base_algorithm
</description>
<author></author>
<license>
BSD
</license>
<author>
Joan Perez, jnperez at iri.upc.edu
</author>
<license>
LGPL
</license>
<review
status=
"unreviewed"
notes=
""
/>
<url>
http://ros.org/wiki/iri_base_algorithm
</url>
...
...
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