Skip to content

Commit

Permalink
Merge pull request dora-rs#425 from dora-rs/c++-ros2-bridge
Browse files Browse the repository at this point in the history
Add ROS2 bridge support for C++ nodes
  • Loading branch information
haixuanTao authored Feb 28, 2024
2 parents d0df0f6 + f258fbe commit edb2a28
Show file tree
Hide file tree
Showing 46 changed files with 1,432 additions and 457 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,14 @@ jobs:
# Reset only the turtlesim instance as it is not destroyed at the end of the previous job
source /opt/ros/humble/setup.bash && ros2 service call /reset std_srvs/srv/Empty &
cargo run --example python-ros2-dataflow --features="ros2-examples"
- name: "c++-ros2-dataflow"
timeout-minutes: 30
env:
QT_QPA_PLATFORM: offscreen
run: |
# Reset only the turtlesim instance as it is not destroyed at the end of the previous job
source /opt/ros/humble/setup.bash && ros2 service call /reset std_srvs/srv/Empty &
cargo run --example cxx-ros2-dataflow --features="ros2-examples"
bench:
name: "Bench"
Expand Down
73 changes: 45 additions & 28 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ members = [
"libraries/extensions/dora-record",
"libraries/extensions/ros2-bridge",
"libraries/extensions/ros2-bridge/msg-gen",
"libraries/extensions/ros2-bridge/msg-gen-macro",
"libraries/extensions/ros2-bridge/python",
]

Expand Down Expand Up @@ -59,6 +58,7 @@ dora-runtime = { version = "0.3.2", path = "binaries/runtime" }
dora-daemon = { version = "0.3.2", path = "binaries/daemon" }
dora-coordinator = { version = "0.3.2", path = "binaries/coordinator" }
dora-ros2-bridge = { path = "libraries/extensions/ros2-bridge" }
dora-ros2-bridge-msg-gen = { path = "libraries/extensions/ros2-bridge/msg-gen" }
dora-ros2-bridge-python = { path = "libraries/extensions/ros2-bridge/python" }
arrow = "48.0.0"
arrow-schema = "48.0.0"
Expand Down Expand Up @@ -138,3 +138,8 @@ path = "examples/multiple-daemons/run.rs"
[[example]]
name = "cmake-dataflow"
path = "examples/cmake-dataflow/run.rs"

[[example]]
name = "cxx-ros2-dataflow"
path = "examples/c++-ros2-dataflow/run.rs"
required-features = ["ros2-examples"]
17 changes: 17 additions & 0 deletions apis/c++/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,28 @@ crate-type = ["staticlib"]
[features]
default = ["tracing"]
tracing = ["dora-node-api/tracing"]
ros2-bridge = [
"dep:dora-ros2-bridge",
"dep:dora-ros2-bridge-msg-gen",
"dep:rust-format",
"dep:prettyplease",
"dep:serde",
"dep:serde-big-array",
]

[dependencies]
cxx = "1.0.73"
dora-node-api = { workspace = true }
eyre = "0.6.8"
dora-ros2-bridge = { workspace = true, optional = true }
futures-lite = { version = "2.2" }
serde = { version = "1.0.164", features = ["derive"], optional = true }
serde-big-array = { version = "0.5.1", optional = true }

[build-dependencies]
cxx-build = "1.0.73"
dora-ros2-bridge-msg-gen = { workspace = true, optional = true }
rust-format = { version = "0.3.4", features = [
"pretty_please",
], optional = true }
prettyplease = { version = "0.1", features = ["verbatim"], optional = true }
Loading

0 comments on commit edb2a28

Please sign in to comment.