-
Notifications
You must be signed in to change notification settings - Fork 97
Add Raspi Example #170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add Raspi Example #170
Conversation
The example reads out Mavlink on Serial and prints all the output as well as moving a servo in response to attitude data. I think it's helpful in terms of showing a bunch of the message formats and a bit of interacting with the data received. |
2749672
to
2e40341
Compare
// Servo configuration. The datasheet was wrong for mine so these are manually calibrated. | ||
// Your configuration may be different. | ||
const PERIOD_MS: u64 = 20; | ||
const PULSE_MIN_US: u64 = 640; | ||
const PULSE_NEUTRAL_US: u64 = 1540; | ||
const PULSE_MAX_US: u64 = 2540; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should provide a more generic and compatible example rather than telling people to adjust these values to fit their system.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could just log stuff out I guess?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense. It's also worth mentioning which RP model this was tested on and confirmed to work.
@@ -0,0 +1,9 @@ | |||
[package] | |||
name = "raspi_mavlink_example" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To match the dir name:
name = "raspi_mavlink_example" | |
name = "raspi" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's worth to rebase the PR with latest master as it's based on extremely old commit right now.
Can't get a working build on my local:
$ remotes/BWStearns/raspi-example $ cargo build
warning: `raspi/.cargo/config` is deprecated in favor of `config.toml`
note: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml`
Updating crates.io index
error: failed to select a version for the requirement `xml-rs = "^0.2"`
version 0.2.0 is yanked
version 0.2.1 is yanked
version 0.2.2 is yanked
version 0.2.3 is yanked
version 0.2.4 is yanked
location searched: crates.io index
required by package `mavlink v0.10.1`
... which satisfies dependency `mavlink = "^0.10.1"` of package `raspi v0.1.0 (rust-mavlink/examples/raspi)`
Added a raspi -> pixhawk4 example.