Skip to content
Snippets Groups Projects
Commit d39b2d6e authored by Robert Hedman's avatar Robert Hedman
Browse files

sync

parent 81e1b92e
No related branches found
No related tags found
No related merge requests found
use std::thread;
use std::sync::mpsc;
const FILE_SIZE: usize = 100*50;
const ROWS: usize = 50;
const COLS: usize = 100;
fn main() {
let map = [[0u32; ROWS]; COLS];
let (requestLocationTX, requestLocationRX): (mpsc::Sender<bool>, mpsc::Receiver<bool>) = mpsc::channel();
let (sendLocationTX, sendLocationRX): (mpsc::Sender<(i32, i32)>, mpsc::Receiver<(i32, i32)>) = mpsc::channel();
......@@ -28,6 +31,7 @@ fn main() {
},
Err(e) => {
//println!("Error: {}, on recieving side.", e);
//thread::sleep_ms(100);
},
};
};
......@@ -48,7 +52,7 @@ fn main() {
// update map
if pos.0 == 10000 {
if pos.0 == 100 {
println!("mapper done.");
requestLocationTX.send(false).unwrap();
break;
......@@ -60,8 +64,8 @@ fn main() {
});
println!("Main wating for join.");
mapper.join();
tracker.join();
mapper.join().unwrap();
tracker.join().unwrap();
println!("end of main");
// pathfinder, takes a map and returns a list of nodes to aim for when driving
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment