pixix4 / ev3dev-lang-rust Goto Github PK
View Code? Open in Web Editor NEWRust language bindings for http://ev3dev.org
License: MIT License
Rust language bindings for http://ev3dev.org
License: MIT License
I could be wrong but currently I do not think it is possible to get the data described here through this library. Main use case would be to get a more accurate wheel position.
When compiling I get the error error: linking with 'cc' failed: exit code: 1
.
I know it is because the .cargo/config file is not set up properly.
But there is only one .cargo/config file in my hole filesystem. Its path is "./home//.cargo/registry/src/github.com-1ecc6299db9ec823/ev3dev-lang-rust-0.9.5/.cargo/config". And I edited this one, so it shows:
[target.armv5te-unknown-linux-gnueabi] linker = "/usr/bin/arm-linux-gnueabi-gcc"
I really don`t know which file to edit or how to compile the program.
Thanks for helping ๐
Think for you work,i like it very much
I have been trying to use makefile for stripping as shown on the template repository. Everything builds fine but when I run make or make strip I get this error : 'rev' is not recognized as an internal or external command,
operable program or batch file.
docker run --rm -v :/build -w /build pixix4/ev3dev-rust:latest arm-linux-gnueabi-strip /build/target/armv5te-unknown-linux-musleabi/release/
arm-linux-gnueabi-strip: '/build/target/armv5te-unknown-linux-musleabi/release/': No such file
make: *** [Makefile:5: strip] Error 1
I can fix this issue by removing artifact and then replacing it with my project name but then i get this issue : 'rev' is not recognized as an internal or external command,
operable program or batch file.
docker run --rm -v :/build -w /build pixix4/ev3dev-rust:latest arm-linux-gnueabi-strip /build/target/armv5te-unknown-linux-musleabi/release/
arm-linux-gnueabi-strip: '/build/target/armv5te-unknown-linux-musleabi/release/': No such file
make: *** [Makefile:5: strip] Error 1
Any help would be greatly appreciated. Thanks in advance
When I compile a hello world example, the file size for the executable is about 3MB, compared to a few KB in C. This is a lot for only printing hello world, but the main problem is, that transferring it over with bluetooth takes about 30s. I assume that is because large portions of the standard library are included, but not required.
I am trying to get HTTP and TCP connections working with the ev3dev rust langauge.
I have run into the error error: failed to run custom build command for
openssl-sys v0.9.99when using
reqwest` crate.
i have tried to follow the cross-compilation instructions. but to me they are very confusing.
could someone help me understand.
Thanks for this great library. The README mentions that this doesn't work with BrickPi. What's the reason it doesn't work and are you planning to add support?
I'm trying to work with de PID values from the tacho motor, but it seens like the atributes names are wrong:
Trying to run something like
let p = motor.get_speed_pid_kp()?; println!("{}", p);
I get the fallowing error (runing with RUST_BACKTRACE=1)
Starting: brickrun -r --directory="/home/robot/ev3_sensor_color/programas" "/home/robot/ev3_sensor_color/programas/ev3dev-color-sensor"
----------
thread 'main' panicked at 'Internal error in the attribute map', C:\Users\lucas.ms\.cargo\registry\src\github.com-1ecc6299db9ec823\ev3dev-lang-rust-0.12.0\src\driver.rs:130:14
stack backtrace:
0: rust_begin_unwind
at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:584:5
1: core::panicking::panic_fmt
at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/panicking.rs:143:14
2: core::panicking::panic_display
at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/panicking.rs:73:5
3: core::panicking::panic_str
at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/panicking.rs:56:5
4: core::option::expect_failed
at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/option.rs:1852:5
5: ev3dev_lang_rust::driver::Driver::get_attribute
6: ev3dev_color_sensor::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
----------
Exited with error code 101.
I think the get_speed_pid_kp()
has the wrong attribute name, reading de ev3dev docs, it looks like the right name is 'speed_pid/Kp' instead of 'speed_pid_kp'
Apologies if this is a dumb question, but as someone new to Mindstorms and this library, I suspect there ought to be a way to pair motors together? Like, if I want to start driving, shouldn't there be a way to start both motors/wheels at the same time?
I see that the Python libraries have a MotorSet
. Is that what I'm thinking it is and is there an equivalent for this library?
When i run cargo build --release --target armv5te-unknown-linux-gnueabi
it gives the following error error: linking with
cc failed: exit code: 1
.
I attached the full log: error.txt
I tried setting target.armv5te-unknown-linux-gnueabi.linker key in Cargo.toml but as you can see in the logs it isn't taken into account (warning: unused manifest key: target.armv5te-unknown-linux-gnueabi.linker
).
How did you manage to compile something for the mindstorms ev3?
I always get a error: cannot find derive macro Device in this scope
This will show the API on docs.rs. Just use #[cfg(any(feature = "screen", doc))]
.
Maybe I'll do a PR later
The introduction of a TachoMotor trait would simplify code that has the possibility of dealing with either a large or a medium motor
I have compiled the example code and downloaded it on my EV3 and it doesn't move the motor. I have tried to use other methods of moving the motors but it is not working.
It would be nice to beable to have a check to see if the screen allows for RGB or B&W.
I have been trying to compile this project with MSYS2 for a while now, but I keep getting this error:
= note: c:/msys64/mingw64/bin/../lib/gcc/arm-none-eabi/10.1.0/../../../../arm-none-eabi/bin/ld.exe: warning: -z relro ignored
c:/msys64/mingw64/bin/../lib/gcc/arm-none-eabi/10.1.0/../../../../arm-none-eabi/bin/ld.exe: cannot find -lgcc_s
c:/msys64/mingw64/bin/../lib/gcc/arm-none-eabi/10.1.0/../../../../arm-none-eabi/bin/ld.exe: cannot find -lutil
c:/msys64/mingw64/bin/../lib/gcc/arm-none-eabi/10.1.0/../../../../arm-none-eabi/bin/ld.exe: cannot find -lrt
c:/msys64/mingw64/bin/../lib/gcc/arm-none-eabi/10.1.0/../../../../arm-none-eabi/bin/ld.exe: cannot find -lpthread
c:/msys64/mingw64/bin/../lib/gcc/arm-none-eabi/10.1.0/../../../../arm-none-eabi/bin/ld.exe: cannot find -ldl
collect2.exe: error: ld returned 1 exit status
I know this means that the linker can't find the libraries libqcc, libutil, librt, libpthread, and libdl. I just haven't found any way to include these libraries. Any help would be greatly appreciated.
I didn't find any useful info, did I miss anything?
Hi! I just acquired an EV3 kit and wanted to write some Rust for it, and your SDK was exactly what I was looking for. I tried to build a simple Hello World program with your instructions, but I couldn't get cross
working under WSL2 on Windows. I decided to try Cargo's built-in cross compilation support with musl
and LLD, and to my surprise it worked without issue.
Here are the steps I took if you want to add them to the README.
armv5te-unknown-linux-musleabi
rustup target add armv5te-unknown-linux-musleabi
.cargo/config.toml
under your project.[build]
target = "armv5te-unknown-linux-musleabi"
[target.armv5te-unknown-linux-musleabi]
linker = "rust-lld"
cargo build --release
And you're done!
I noticed that the Ev3Button.proccess
function says to call any button event listeners depending on if the button's state has changed.
what does this mean? because i can't find any part of ev3dev-lang-rust
crate that lets you create event listeners.
I might have missed something.
but, this would be a great feature to have.
i copied the screen.rs example.
i get these errors
mismatched types
`Rgb<{integer}>` and `image::color::Rgb<u8>` have similar names, but are actually distinct types
perhaps two different versions of crate `image` are being used?
the trait bound `image::buffer_::ImageBuffer<image::color::Rgb<u8>, Vec<u8>>: GenericImageView` is not satisfied
the following other types implement trait `GenericImageView`:
View<Buffer, P>
ViewMut<Buffer, P>
ImageBuffer<P, Container>
DynamicImage
image::image::SubImageInner<I>
Hi,
I'm trying to use threading in my robot software. But this library uses Rc which cannot be used over thread borders. I've read that it is possible to replace Rc with Arc which is accepted from the Rust compiler to be used in concurring threads. I'm completely new to Rust and I'm using my Mindstorms Robots to learn it ;/ So I'm not able to send in a good PR.
So is this possible and a good Idea to replace this in this library?
At the moment I simply used a extra datastructure which uses Arc<Mutex<>> to exchange data between my threads. This datastructure is filled inside a thread from the corresponding sensor. So it is not really burning but annoying problem.
Example Error
Compiling run_on_console v0.1.0 (/build) error[E0277]:
Rc<RefCell>cannot be sent between threads safely --> src/main.rs:56:5 | 56 | thread::spawn(move || { | ^^^^^^^^^^^^^
Rc<RefCell>cannot be sent between threads safely | = help: within
(String, Attribute), the trait
Sendis not implemented for
Rc<RefCell>= note: required because it appears within the type
Attribute= note: required because it appears within the type
(String, Attribute)= note: required because of the requirements on the impl of
Sendfor
hashbrown::raw::RawTable<(String, Attribute)>= note: required because it appears within the type
hashbrown::map::HashMap<String, Attribute, RandomState>= note: required because it appears within the type
HashMap<String, Attribute>= note: required because of the requirements on the impl of
Sendfor
RefCell<HashMap<String, Attribute>>= note: required because it appears within the type
Driver= note: required because it appears within the type
UltrasonicSensor= note: required because it appears within the type
[closure@src/main.rs:56:19: 62:6]``
Code which produces this Error:
fn main() { .... let ultrasonic = UltrasonicSensor::get(SensorPort::In4).unwrap(); ultrasonic.set_mode_us_dc_cm().unwrap(); let bar = Distance::new(); let mut bar1 = bar.clone(); thread::spawn(move || loop { bar1.update(ultrasonic.get_distance_centimeters().unwrap()); thread::sleep(Duration::from_millis(10)); }); ...
So quite simply when you use draw something to the display in a program that doesn't exit the key press symbols (example ^CCA) will over write what ever you put on the display.
To reproduce you can add
loop {
}
to the bottom of the screen example and then press the arrow keys on the ev3.
I think this is caused by the tty not being in a "graphics mode" or with keyboard mode on as this is what the java bindings do in OwnedDisplay::switchToGraphicsMode and the java bindings dont have this problem.
When looking at the documentation for (the recently implemented) IrSeekerSensor it looks really cluttered and you can just bypass the much nicer interface that is provided in the source file.
I have been unable to control motors on my EV3 running EV3Dev and this library. The program will continue through motor control instructions however it will not execute them.
I have tested across multiple EV3s and sets of motors using both custom and example code provided. While this will not work, EV3Dev Python works on all of these systems โ so it is a problem specific to this library.
I would appreciate any help. I'm not sure what additional information to include.
Thank you in advance!
Hello,
I tried to use completion with this library and I had a rough time (here is a summary what I tried to do).
Did you manage to use completion with the library without macro expansion?
Thanks.
As of right now, Ev3Error does not implement std's Error trait. This makes error handling more difficult and prevents usage with existing error handling libraries (ie anyhow) as a wrapper type is need.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.