Skip to content

Commit

Permalink
fixed up post generation to compile.
Browse files Browse the repository at this point in the history
  • Loading branch information
gbin committed May 20, 2024
1 parent 1ae37ed commit 287486f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion examples/config-gen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use copper::config::Value;
/// This is useful for making variations of your robot more easily.
fn main() {
// Generate a config
let mut copperconfig = CopperConfig::new();
let mut copperconfig = CopperConfig::default();
let mut camera =
ConfigNode::new("camera", "camerapkg::Camera")
.set_base_period(Time::new::<second>(60.into()));
Expand Down
19 changes: 10 additions & 9 deletions examples/pluginload/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
use copper::config::CopperConfig;
use copper::config::ConfigNode;
use uom::si::rational::Time;
use uom::si::time::second;

fn main() {
use copper::config::ConfigNode;
use copper::config::CopperConfig;

let mut copperconfig = CopperConfig::new();
let mut camera = ConfigNode::new("copper-camera", "camerapkg::Camera").set_base_period(Time::new::<second>(60.into()));
fn main() {
let mut copperconfig = CopperConfig::default();
let mut camera = ConfigNode::new("copper-camera", "camerapkg::Camera")
.set_base_period(Time::new::<second>(60.into()));
camera.set_param::<i32>("resolution-height", 1080);
camera.set_param::<i32>("resolution-width", 1920);
let mut isp = ConfigNode::new("copper-isp", "isppkg::Isp").set_base_period(Time::new::<second>(1.into()));
let mut isp =
ConfigNode::new("copper-isp", "isppkg::Isp").set_base_period(Time::new::<second>(1.into()));
isp.set_param::<f64>("tone", 1.3);
let algo = ConfigNode::new("copper-algo", "algopkg::Algo").set_base_period(Time::new::<second>(5.into()));
let algo = ConfigNode::new("copper-algo", "algopkg::Algo")
.set_base_period(Time::new::<second>(5.into()));
let n1 = copperconfig.add_node(isp);
let n2 = copperconfig.add_node(camera);
let n3 = copperconfig.add_node(algo);

copperconfig.connect(n2, n1, "imgmsgpkg::Image");
copperconfig.connect(n1, n3, "imgmsgpkg::Image");
println!("{}", copperconfig.serialize());


{
let mut file = std::fs::File::create("/tmp/copperconfig.dot").unwrap();
copperconfig.render(&mut file);
}

}
2 changes: 1 addition & 1 deletion examples/simplelogger/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use copper::config::NodeConfig;
use copper::cutask::{CuResult, CuSinkTask};
use v4lsrc::ImageMsg;

struct SimpleLogger {
pub struct SimpleLogger {
path: String,
log_file: Option<File>,
}
Expand Down
2 changes: 1 addition & 1 deletion examples/v4lsrc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl ImageMsg {
}
}

struct Video4LinuxSource {
pub struct Video4LinuxSource {
device: Device,
stream: Option<Stream<In, Mmap>>,
}
Expand Down

0 comments on commit 287486f

Please sign in to comment.