Skip to content

Instantly share code, notes, and snippets.

@jimweirich
Created March 6, 2013 22:16
Show Gist options
  • Save jimweirich/5103604 to your computer and use it in GitHub Desktop.
Save jimweirich/5103604 to your computer and use it in GitHub Desktop.
Some unusual Ruby code I've been working on today.
class NavOptionDemo < NavOption
include CFields
uint32_t :ctrl_state # Flying state (landed, flying,
# hovering, etc.) defined in
# CTRL_STATES enum.
uint32_t :vbat_flying_percentage # battery voltage filtered (mV)
alias :battery_level :vbat_flying_percentage
float32_t :theta # UAV's pitch in milli-degrees
float32_t :phi # UAV's roll in milli-degrees
float32_t :psi # UAV's yaw in milli-degrees
int32_t :altitude # UAV's altitude in centimeters
float32_t :vx # UAV's estimated linear velocity
float32_t :vy # UAV's estimated linear velocity
float32_t :vz # UAV's estimated linear velocity
uint32_t :num_frames # streamed frame index // Not
# used -> To integrate in video
# stage.
# ....
end
@DaveCollinsJr
Copy link

Love it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment