Skip to content

Commit b9f3136

Browse files
committed
Added skeleton examples for action client and server
1 parent 087527e commit b9f3136

File tree

4 files changed

+77
-0
lines changed

4 files changed

+77
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[package]
2+
name = "examples_rclrs_minimal_action_client_server"
3+
version = "0.3.1"
4+
# This project is not military-sponsored, Jacob's employment contract just requires him to use this email address
5+
authors = ["Esteve Fernandez <[email protected]>", "Nikolai Morin <[email protected]>", "Jacob Hassold <[email protected]>"]
6+
edition = "2021"
7+
8+
[[bin]]
9+
name = "minimal_action_client"
10+
path = "src/minimal_action_client.rs"
11+
12+
[[bin]]
13+
name = "minimal_action_server"
14+
path = "src/minimal_action_server.rs"
15+
16+
[dependencies]
17+
anyhow = {version = "1", features = ["backtrace"]}
18+
19+
[dependencies.rclrs]
20+
version = "0.3"
21+
22+
[dependencies.rosidl_runtime_rs]
23+
version = "0.3"
24+
25+
[dependencies.action_msgs]
26+
version = "*"
27+
28+
[package.metadata.ros]
29+
install_to_share = ["launch"]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0"?>
2+
<?xml-model
3+
href="http://download.ros.org/schema/package_format3.xsd"
4+
schematypens="http://www.w3.org/2001/XMLSchema"?>
5+
<package format="3">
6+
<name>examples_rclrs_minimal_action_client_server</name>
7+
<version>0.3.1</version>
8+
<description>Package containing an example of actions in rclrs.</description>
9+
<maintainer email="[email protected]">Esteve Fernandez</maintainer>
10+
<maintainer email="[email protected]">Nikolai Morin</maintainer>
11+
<!-- This project is not military-sponsored, Jacob's employment contract just requires him to use this email address -->
12+
<maintainer email="[email protected]">Jacob Hassold</maintainer>
13+
<license>Apache License 2.0</license>
14+
15+
<build_depend>rclrs</build_depend>
16+
<build_depend>rosidl_runtime_rs</build_depend>
17+
<build_depend>action_msgs</build_depend>
18+
19+
<exec_depend>rclrs</exec_depend>
20+
<exec_depend>rosidl_runtime_rs</exec_depend>
21+
<exec_depend>action_msgs</exec_depend>
22+
23+
<export>
24+
<build_type>ament_cargo</build_type>
25+
</export>
26+
</package>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
use std::env;
2+
3+
use anyhow::{Error, Result};
4+
5+
fn main() -> Result<(), Error> {
6+
let context = rclrs::Context::new(env::args())?;
7+
8+
let _node = rclrs::create_node(&context, "minimal_action_client")?;
9+
10+
Ok(())
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
use std::env;
2+
3+
use anyhow::{Error, Result};
4+
5+
fn main() -> Result<(), Error> {
6+
let context = rclrs::Context::new(env::args())?;
7+
8+
let mut node = rclrs::create_node(&context, "minimal_action_server")?;
9+
10+
rclrs::spin(&node).map_err(|err| err.into())
11+
}

0 commit comments

Comments
 (0)