Skip to content

Commit b4f381d

Browse files
authored
Update README.md
1 parent 17b04a2 commit b4f381d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,22 @@ const AddTwoInts = rosnodejs.require('beginner_tutorials').srv.AddTwoInts;
6161
const service = nh.advertiseService('/add_two_ints', AddTwoInts, (req, resp) => { ... });
6262
const client = nh.serviceClient('/add_two_ints', AddTwoInts);
6363
```
64+
## Actions (Experimental)
65+
```
66+
const nh = rosnodejs.nh;
67+
const as = new rosnodejs.ActionServer({
68+
nh,
69+
type: 'turtle_actionlib/ShapeAction',
70+
actionServer: '/turtle_shape'
71+
});
6472
73+
as.on('goal, function (goal) {
74+
goal.setAccepted();
75+
});
76+
77+
const ac = nh.actionClientInterface('/turtle_shape, 'turtle_actionlib/ShapeAction');
78+
ac.sendGoal({ goal: {edges: 3, radius: 1}});
79+
```
6580
## Run the turtlesim example
6681

6782
Start:

0 commit comments

Comments
 (0)