Skip to content

Commit 90bd057

Browse files
committed
Fix build instructions and ROS1 code
1 parent 3cdb56e commit 90bd057

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ gstreamer = "0.24.2"
1616
gstreamer-app = "0.24.2"
1717
bytes = "1.10.1"
1818
thiserror = "2.0.17"
19+
env_logger = "0.11.8"
20+
log = "0.4.28"
1921

2022
# ROS 1 dependencies
2123
rosrust = { version = "0.9.12", optional = true }
@@ -26,8 +28,6 @@ rclrs = { version = "*", optional = true }
2628
geometry_msgs = { version = "*", optional = true }
2729
sensor_msgs = { version = "*", optional = true }
2830
std_msgs = { version = "*", optional = true }
29-
env_logger = "0.11.8"
30-
log = "0.4.28"
3131

3232
[features]
3333
default = ["ros2"]

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,21 @@ Finally, ROS is required. ROS 1 and ROS 2 are both supported.
2121

2222
Follow the installation instructions here: https://wiki.ros.org/noetic/Installation/Ubuntu
2323

24+
Unfortunately, dependency management is difficult with this package due to its dependency on `ros2rust`, which requires the packages to be built locally. To make this package easier to compile, open `Cargo.toml` and remove the `ros2` feature and the dependencies listed for ROS 2. Also set the default features to ros1.
25+
2426
Then, build the package by running:
2527

2628
```bash
27-
cargo build --features ros1 --no-default-features
29+
source /opt/ros/noetic/setup.bash
30+
cargo build
2831
```
2932

3033
You can run the package with logging enabled using:
3134

3235
```bash
33-
RUST_LOG=debug cargo run --features ros1 --no-default-features
36+
RUST_LOG=debug cargo run
3437
```
3538

36-
*Alternatively, edit the Cargo.toml file such that ros1 is the default feature, then run without any of the --features or --no-default-features flags.*
37-
3839
## ROS 2
3940

4041
Follow the installation instructions here: https://docs.ros.org/en/jazzy/Installation/Ubuntu-Install-Debs.html

src/ros_bridge/ros1_bridge.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use std::sync::{Arc, Mutex};
33
use bytes::Bytes;
44
use log::{debug, error};
55
use rosrust::{Publisher, Subscriber};
6-
use std::pin::Pin;
76
use tokio::sync::mpsc;
87

98
use crate::{
@@ -13,7 +12,7 @@ use crate::{
1312

1413
pub struct RosBridge {
1514
_image_sub: Subscriber,
16-
image_listeners: Arc<Mutex<Vec<RosBridgeOnFrameCallback>>>,
15+
image_listeners: Arc<Mutex<Vec<OnCameraImageHdlrFn>>>,
1716
mvmt_pub: Publisher<rosrust_msg::geometry_msgs::Twist>,
1817
}
1918

@@ -25,7 +24,6 @@ impl RosBridge {
2524

2625
let (tx, mut rx) = mpsc::channel::<Bytes>(10);
2726

28-
let listeners_clone = Arc::clone(image_listeners);
2927
let image_sub = rosrust::subscribe(
3028
"/camera/image_raw",
3129
1,

0 commit comments

Comments
 (0)