Skip to content

Commit 8ab6705

Browse files
author
Minggang Wang
committed
Update README.md
This patch updates: - Add the release info for v0.10.3. - Remove the deprecated actionlib information. Fix #None
1 parent 101bd4b commit 8ab6705

File tree

2 files changed

+31
-17
lines changed

2 files changed

+31
-17
lines changed

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ If you want to select a stable release of ROS 2.0 as your platform, please check
1111

1212
| ROS 2.0 release | NPM version |
1313
| :-----------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------: |
14-
| Eloquent Elusor Patch Release [1](https://github.com/ros2/ros2/releases/tag/release-eloquent-20200124) | [0.12.0](https://github.com/RobotWebTools/rclnodejs/tree/0.12.0) ([doc](http://robotwebtools.org/rclnodejs/docs/0.12.0/index.html)) |
14+
| Eloquent Elusor Patch Release [1](https://github.com/ros2/ros2/releases/tag/release-eloquent-20200124) | [0.13.0](https://github.com/RobotWebTools/rclnodejs/tree/0.13.0) ([doc](http://robotwebtools.org/rclnodejs/docs/0.13.0/index.html)) |
1515
| [Eloquent Elusor](https://github.com/ros2/ros2/releases/tag/release-eloquent-20191122) | [0.11.1](https://github.com/RobotWebTools/rclnodejs/releases/tag/0.11.1) |
1616
| Dashing Diademata Patch Release [4](https://github.com/ros2/ros2/releases/tag/release-dashing-20191018) | [0.10.3](https://github.com/RobotWebTools/rclnodejs/releases/tag/0.10.3) |
1717
| Dashing Diademata Patch Release [3](https://github.com/ros2/ros2/releases/tag/release-dashing-20190910) | [0.10.2](https://github.com/RobotWebTools/rclnodejs/releases/tag/0.10.2) |
@@ -176,10 +176,6 @@ The benefits of using TypeScript become evident when working with more complex m
176176

177177
Smart TypeScript tools such as Visual Studio Code and the CodeMix plugin for Eclipse will help you learn the rclnodejs api and identify issues while coding rather than at runtime.
178178

179-
## Experimental - Deprecated
180-
181-
- [actionlib](https://github.com/RobotWebTools/rclnodejs/blob/develop/tutorials/actionlib.md) - as the [rcl](https://github.com/ros2/rcl) library has implemented the action related functions, we are going to drop this one and we don't guarantee the current actionlib can work with [rclcpp](https://github.com/ros2/rclcpp).
182-
183179
## Troubleshooting
184180

185181
### Maximum call stack size exceeded error when running in Jest

tutorials/actionlib.md

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
# Introduction
1+
# Introduction - Deprecated, please reference examples under /example for the usage based on the latest implementation.
2+
23
Actionlib tutorial based on `rclnodejs`.
34

45
## Actionlib background
6+
57
To continue the tutorial, you should have some basic understanding of the `action` term in ROS. If you're not familar with it, please refer to the [description](http://wiki.ros.org/actionlib/DetailedDescription).
68

79
## Precondition
10+
811
You should prepare an action text file. The content is like this:
912

1013
```
@@ -23,41 +26,50 @@ sensor_msgs/Image image
2326
Fortunately, there is a `dodishes.action` file that is already available in the `test/ros1_actions` directory.
2427

2528
## Basic steps of processing action files for rclnodejs
29+
2630
For `rclnodejs`, the basic steps of process an action file is separated into 2 steps:
27-
* Generate several msg files and the js message package from the action file.
28-
* Build the shared library from the msg files that will be used in running actionlib-feature-related code.
31+
32+
- Generate several msg files and the js message package from the action file.
33+
- Build the shared library from the msg files that will be used in running actionlib-feature-related code.
2934

3035
### Generate msg files from the action file
36+
3137
The `generated` directory contains the generated js message package for `rclnodejs`. If you have run `npm install`, then it should
3238
exist after `npm install` was done. However, since your `AMENT_PREFIX_PATH` may not include the directory path of the action file, the `ros1_actions` package may not be generated. So you need remove the whole `generated` directory and regenerate them.
39+
3340
```
3441
$ rm -fr generated
3542
$ export AMENT_PREFIX_PATH=$AMENT_PREFIX_PATH:$(pwd)/test/ros1_actions
3643
$ node scripts/generate_messages.js
3744
```
3845

3946
### Build the shared library from the msg files
47+
4048
```
4149
$ cd test/ros1_actions
4250
$ colcon build
4351
```
4452

4553
## Run the action example
54+
4655
After the build, you can run the action example. The action example contains two parts, one is the [action server](./example/action-server-example.js), another is the [action client](./example/action-client-example.js). When running the example, you should launch the server first, and then launch the client.
4756

48-
* Launch a terminal session, load ROS2 environment and go to `rclnodejs` directory.
57+
- Launch a terminal session, load ROS2 environment and go to `rclnodejs` directory.
58+
4959
```
5060
$ source test/ros1_actions/install/local_setup.bash
5161
$ node example/action-server-example.js
5262
```
5363

54-
* Launch another terminal session, load ROS2 environment and go to `rclnodejs` directory.
64+
- Launch another terminal session, load ROS2 environment and go to `rclnodejs` directory.
65+
5566
```
5667
$ source test/ros1_actions/install/local_setup.bash
5768
$ node example/action-client-example.js
5869
```
5970

6071
Here is the action client output:
72+
6173
```
6274
The goal was sent, the goal id is 7c28f24a-5ce8-4b13-a2aa-7aa62128fd03
6375
70% of the task has been completed.
@@ -67,13 +79,16 @@ The goal, whose id is 7c28f24a-5ce8-4b13-a2aa-7aa62128fd03, has been executed su
6779
```
6880

6981
And here is the action server output:
82+
7083
```
7184
A goal, whose id is 7c28f24a-5ce8-4b13-a2aa-7aa62128fd03, was received.
7285
```
7386

7487
## Explaination of the action example:
88+
7589
1. Action server
76-
For the action server, the skeleton code is like this:
90+
For the action server, the skeleton code is like this:
91+
7792
```
7893
rclnodejs.init().then(() => {
7994
const as = new rclnodejs.ActionLib.ActionServer({
@@ -103,13 +118,15 @@ rclnodejs.init().then(() => {
103118
First, you should new an `ActionServer` with the `type` and the `actionServer`. The `type` is the action package name and the `actionServer` is the name of the action server, which should be the same as the action client request to in future.
104119

105120
The `ActionServer` can emit 2 type events: `goal` and `cancel` events.
106-
* `goal` event: triggered when an action client sends an goal to the action server by calling its `sendGoal()` method. In the handler of the this event, you can accept the goal by calling `goal.setAccepted()`. During executing the goal, you can send a feedback to the action client by calling `goal.publishFeedback()`. Once the goal is completed, you should set the goal status by calling `goal.setSucceeded()`, which will trigger the `result` event for the action client.
107-
* `cancel` event: triggered when an action client cancels the the goal after a goal was sent to the action server but not completed yet.
121+
122+
- `goal` event: triggered when an action client sends an goal to the action server by calling its `sendGoal()` method. In the handler of the this event, you can accept the goal by calling `goal.setAccepted()`. During executing the goal, you can send a feedback to the action client by calling `goal.publishFeedback()`. Once the goal is completed, you should set the goal status by calling `goal.setSucceeded()`, which will trigger the `result` event for the action client.
123+
- `cancel` event: triggered when an action client cancels the the goal after a goal was sent to the action server but not completed yet.
108124

109125
The `start()` method must be called to start the action server.
110126

111127
2. Action client
112-
For the action client, the skeleton code is like this:
128+
For the action client, the skeleton code is like this:
129+
113130
```
114131
rclnodejs.init().then(() => {
115132
const GoalStatus = rclnodejs.require('actionlib_msgs/msg/GoalStatus');
@@ -144,8 +161,9 @@ rclnodejs.init().then(() => {
144161
```
145162

146163
To construct an action client, use `new rclnodejs.ActionClientInterface()`. The action client can emit 3 type events:
147-
* `status` event: tirggered when the action server sends messages to the action client during the goal is executing.
148-
* `feedback` event: triggered after the action server called `publishFeedback`.
149-
* `result` event: triggered after the action server called `setSucceeded`.
164+
165+
- `status` event: tirggered when the action server sends messages to the action client during the goal is executing.
166+
- `feedback` event: triggered after the action server called `publishFeedback`.
167+
- `result` event: triggered after the action server called `setSucceeded`.
150168

151169
**Notice**, the action state transitions must obey some specific order, for more details please refer to [this articile](http://wiki.ros.org/actionlib/DetailedDescription)

0 commit comments

Comments
 (0)