Skip to content

Conversation

BWStearns
Copy link

Added a raspi -> pixhawk4 example.

@BWStearns
Copy link
Author

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.

@patrickelectric patrickelectric force-pushed the master branch 2 times, most recently from 2749672 to 2e40341 Compare July 21, 2024 23:37
Comment on lines +10 to +15
// 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;
Copy link
Collaborator

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.

Copy link
Author

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?

Copy link
Collaborator

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"
Copy link
Collaborator

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:

Suggested change
name = "raspi_mavlink_example"
name = "raspi"

Copy link
Collaborator

@onur-ozkan onur-ozkan left a 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)`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants