Skip to content

Commit 899258c

Browse files
Merge remote-tracking branch 'origin/toolchain-2.9' into move-typekits-back-to-rtt_common_msgs
typekits/rtt_std_msgs/include/orocos/std_msgs/vector_multi_array_adapter.h
2 parents 0fff259 + 69692a8 commit 899258c

File tree

107 files changed

+2783
-1493
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+2783
-1493
lines changed

.travis.yml

Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,43 @@
1-
sudo: required
2-
dist: trusty
3-
language: generic
4-
compiler:
5-
- gcc
6-
before_install:
7-
# Define some config vars
8-
- export ROS_DISTRO=indigo
9-
- export CI_SOURCE_PATH=$(pwd)
10-
# Bootstrap a minimal ROS installation
11-
- git clone https://github.com/orocos/ros_ci_tools /tmp/ros_ci_tools && export PATH=/tmp/ros_ci_tools:$PATH
12-
- ros_ci_bootstrap
13-
- source /opt/ros/$ROS_DISTRO/setup.bash
14-
# Clone https://github.com/orocos/rtt_common_msgs.git (default branch)
15-
- git clone https://github.com/orocos/rtt_common_msgs.git
16-
# Create non-isolated workspace
17-
- mkdir -p ~/ws/src
18-
- pushd ~/ws/src
19-
- ln -s $CI_SOURCE_PATH
20-
- popd
21-
- rosdep install -r --from-paths ~/ws/src --ignore-src --rosdistro $ROS_DISTRO -y > /dev/null
22-
# Source the ROS setup script again due to eventually updated env-hooks
23-
- source /opt/ros/$ROS_DISTRO/setup.bash
1+
# This config uses industrial_ci (https://github.com/ros-industrial/industrial_ci.git).
2+
# For troubleshooting, see readme (https://github.com/ros-industrial/industrial_ci/blob/master/README.rst)
243

25-
install:
26-
# build the normal catkin workspace
27-
- pushd ~/ws
28-
- catkin_make -j2
4+
language: generic # optional, just removes the language badge
5+
6+
services:
7+
- docker
8+
9+
# include the following block if the C/C++ build artifacts should get cached by Travis,
10+
# CCACHE_DIR needs to get set as well to actually fill the cache
11+
cache:
12+
directories:
13+
- $HOME/.ccache
14+
15+
git:
16+
quiet: true # optional, silences the cloning of the target repository
2917

18+
# limit automatic builds to certain branches (and pull requests)
19+
branches:
20+
only:
21+
- master
22+
- /^toolchain-[\d\.]+[\d]$/
23+
24+
# configure the build environment(s)
25+
# https://github.com/ros-industrial/industrial_ci/blob/master/doc/index.rst#variables-you-can-configure
26+
env:
27+
global: # global settings for all jobs
28+
- ROS_REPO=ros
29+
- CCACHE_DIR=$HOME/.ccache # enables C/C++ caching in industrial_ci
30+
matrix: # each line is a job
31+
- ROS_DISTRO="kinetic"
32+
#- ROS_DISTRO="melodic"
33+
34+
# allow failures, e.g. for unsupported distros
35+
#matrix:
36+
# allow_failures:
37+
# - env: ROS_DISTRO="lunar" ROS_REPO=ros-shadow-fixed
38+
39+
# clone and run industrial_ci
40+
install:
41+
- git clone --quiet --depth 1 https://github.com/ros-industrial/industrial_ci.git .industrial_ci
3042
script:
31-
# Run tests
32-
- source devel/setup.bash
33-
- catkin_make run_tests
34-
- catkin_test_results
35-
#- catkin_make install
43+
- .industrial_ci/travis.sh

LICENSE

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Copyright (c) 2010, KU Leuven, Intermodalics BVBA and contributors
2+
3+
Redistribution and use in source and binary forms, with or without modification,
4+
are permitted provided that the following conditions are met:
5+
6+
1. Redistributions of source code must retain the above copyright notice, this
7+
list of conditions and the following disclaimer.
8+
9+
2. Redistributions in binary form must reproduce the above copyright notice,
10+
this list of conditions and the following disclaimer in the documentation
11+
and/or other materials provided with the distribution.
12+
13+
3. Neither the name of the copyright holder nor the names of its contributors
14+
may be used to endorse or promote products derived from this software without
15+
specific prior written permission.
16+
17+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
21+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,3 +326,40 @@ respectively. See [rtt_roscomm](rtt_roscomm) for more information.
326326
The `rtt_actionlib` package provides a C++ API and an RTT service for
327327
implementing [actionlib](http://www.ros.org/wiki/actionlib) actions with Orocos
328328
RTT components. See [rtt_actionlib](rtt_actionlib) for more information.
329+
330+
## Acknowledgement
331+
332+
Many thanks to [all the contributors](https://github.com/orocos/rtt_ros_integration/graphs/contributors) to this repository.
333+
334+
- Peter Soetens
335+
- Ruben Smits
336+
- Jonathan Bohren
337+
- Johannes Meyer
338+
- Antoine Hoarau
339+
- Steven Bellens
340+
- ...and [others](https://github.com/orocos/rtt_ros_integration/graphs/contributors).
341+
342+
This work has been funded with support from
343+
344+
<a href="https://www.houstonmechatronics.com/">
345+
<img src="https://s27934.pcdn.co/wp-content/uploads/2020/03/HMI_LOGO_OLD_Black_01-1.png"
346+
alt="Houston Mechatronics Logo" height="60">
347+
348+
Houston Mechatronics
349+
</a>
350+
351+
and
352+
353+
<a href="http://rosin-project.eu">
354+
<img src="http://rosin-project.eu/wp-content/uploads/rosin_ack_logo_wide.png"
355+
alt="rosin_logo" height="60" >
356+
</a>
357+
358+
Supported by ROSIN - ROS-Industrial Quality-Assured Robot Software Components.
359+
More information: <a href="http://rosin-project.eu">rosin-project.eu</a>
360+
361+
<img src="http://rosin-project.eu/wp-content/uploads/rosin_eu_flag.jpg"
362+
alt="eu_flag" height="45" align="left" >
363+
364+
This project has received funding from the European Union’s Horizon 2020
365+
research and innovation programme under grant agreement no. 732287.

rtt_actionlib/CHANGELOG.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
Changelog for package rtt_actionlib
33
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44

5+
2.9.2 (2019-05-15)
6+
------------------
7+
58
2.9.1 (2017-11-16)
69
------------------
710

rtt_actionlib/README.md

Lines changed: 89 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,102 @@ some_component_name.actionlib.connectSub(
138138
139139
```
140140

141+
### RTTSimpleActionServer
142+
143+
`RTTSimpleActionServer` is simple version of action server which able to pursue only one goal at one time.
144+
It depends on EventPort callbacks so unable to function if component is not Running or callbacks behavior is changed by redefining `dataOnPortHook()`.
145+
146+
`RTTSimpleActionServer` implements following goal policy:
147+
* New goals gets PENDING status and stored in buffer. It cancels old pending goal if it presents.
148+
After receiving new goal `newGoalHook` callback is called, also `isPending()` and `getPendingGoal()` methods can be used to poll pending goal.
149+
* Pending goal can be accepted (`acceptPending()`) or rejected (`rejectPending()`). If accepted pending goal preempts current active goal if it presents. So only one goal can be active at time.
150+
* State of active goal can be checked with `isActive()`, `getActiveGoal()` and `isPreemting()` calls.
151+
* Cancel request causes pending goal to be canceled immediately. Active goal changes state to PREEMTING and `cancelGoalHook` is called. Preemting state can be checked by `isPreemting()` call.
152+
* State of active goal can be changed by `succeedActive()`, `cancelActive()`, `abortActive()` calls.
153+
154+
```cpp
155+
class Component : public TaskContext
156+
{
157+
protected:
158+
// Goal, Feedback, Result typedefs
159+
ACTION_DEFINITION(ActionSpec);
160+
161+
protected:
162+
RTTSimpleActionServer<ActionSpec> action_server;
163+
// Current goal cache
164+
Goal goal;
165+
166+
// new pending goal is received
167+
void newGoalHook(const Goal& pending_goal) {
168+
// check if goal is valid
169+
if (!isOk(pending_goal)) action_server.rejectPending(result);
170+
else {
171+
goal = pending_goal;
172+
action_server.acceptPending(result);
173+
}
174+
}
175+
176+
// active goal is being cancelled.
177+
void cancelGoalHook() {
178+
// cancel goal
179+
action_server.cancelActive(result);
180+
}
181+
182+
183+
public:
184+
Component(std::string const& name) :
185+
action_server(this->provides())
186+
{
187+
// action server hook registration
188+
action_server.setGoalHook(boost::bind(&SomeComponent::newGoalHook, this, _1));
189+
action_server.setCancelHook(boost::bind(&SomeComponent::cancelGoalHook, this));
190+
}
191+
192+
bool updateHook() {
193+
if (action_server.isActive()) {
194+
// pursue goal
195+
}
196+
}
197+
198+
void stopHook() {
199+
action_server.abortActive(result);
200+
action_server.rejectPending(Result());
201+
}
202+
};
203+
```
204+
205+
Alternatively goal state changes can be monitored in `updateHook()`:
206+
207+
```cpp
208+
bool updateHook() {
209+
if (action_server.isPending()) {
210+
if (! isOk(getPendingGoal())) rejectPending(Result());
211+
else {
212+
Result active_goal_result;
213+
// make preparation
214+
goal = *getPendingGoal();
215+
acceptPending(active_goal_result);
216+
}
217+
218+
}
219+
if (action_server.isActive()) {
220+
// pursue goal
221+
}
222+
else if (action_server.isPreemting()) {
223+
Result active_goal_result;
224+
// cancel goal
225+
action_server.cancelActive(active_goal_result);
226+
}
227+
}
228+
```
229+
141230
Future Work
142231
-----------
143232

144233
* Add operation to actionlib service which connects goal/cancel callbacks to
145234
given RTT operations so that any RTT component with operations with the right
146235
types can be bound to an actionlib service
147236
* Add action client support.
148-
* Add a "simple" mode which implememnts a policy like SimpleActionServer
149237

150238

151239

rtt_actionlib/include/rtt_actionlib/rtt_action_server.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ namespace rtt_actionlib {
7070
//! Check if the server is ready to be started
7171
bool ready();
7272

73+
//! \brief Shutdown internal timer
74+
void shutdown();
75+
7376
//! \brief Set up status publishing timers
7477
virtual void initialize();
7578

@@ -168,6 +171,12 @@ namespace rtt_actionlib {
168171
return action_bridge_.allConnected();
169172
}
170173

174+
template <class ActionSpec>
175+
void RTTActionServer<ActionSpec>::shutdown()
176+
{
177+
status_timer_.killTimer(0);
178+
}
179+
171180
template <class ActionSpec>
172181
bool RTTActionServer<ActionSpec>::addPorts(
173182
RTT::Service::shared_ptr service,

0 commit comments

Comments
 (0)