diff options
author | James Goppert <james.goppert@gmail.com> | 2013-06-29 17:04:43 -0400 |
---|---|---|
committer | James Goppert <james.goppert@gmail.com> | 2013-07-28 00:05:56 -0400 |
commit | 308f1dbfa4787e84665a3e822ddf7d1979f023ca (patch) | |
tree | 0618e020ac6551e7fdfb4eca37decee6322c8639 /src/drivers/md25/md25.cpp | |
parent | 4cfcea176785975590d1d2952eb0b0270a6949b3 (diff) | |
download | px4-firmware-308f1dbfa4787e84665a3e822ddf7d1979f023ca.tar.gz px4-firmware-308f1dbfa4787e84665a3e822ddf7d1979f023ca.tar.bz2 px4-firmware-308f1dbfa4787e84665a3e822ddf7d1979f023ca.zip |
Added amplitude frequency to md25sine command.
Diffstat (limited to 'src/drivers/md25/md25.cpp')
-rw-r--r-- | src/drivers/md25/md25.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/drivers/md25/md25.cpp b/src/drivers/md25/md25.cpp index 9dac5e5ea..1079005c0 100644 --- a/src/drivers/md25/md25.cpp +++ b/src/drivers/md25/md25.cpp @@ -560,7 +560,7 @@ int md25Test(const char *deviceName, uint8_t bus, uint8_t address) return 0; } -int md25Sine(const char *deviceName, uint8_t bus, uint8_t address) +int md25Sine(const char *deviceName, uint8_t bus, uint8_t address, float amplitude, float frequency) { printf("md25 sine: starting\n"); @@ -576,9 +576,7 @@ int md25Sine(const char *deviceName, uint8_t bus, uint8_t address) md25.setSpeedRegulation(true); md25.setTimeout(true); float dt = 0.01; - float amplitude = 0.5; - float frequency = 1.0; - float t_final = 120.0; + float t_final = 60.0; float prev_revolution = md25.getRevolutions1(); // debug publication @@ -599,8 +597,6 @@ int md25Sine(const char *deviceName, uint8_t bus, uint8_t address) // output md25.readData(); float current_revolution = md25.getRevolutions1(); - float output_speed_rpm = 60*(current_revolution - prev_revolution)/dt; - mavlink_log_info(mavlink_fd, "rpm: %10.4f\n", (double)output_speed_rpm); // send input message //strncpy(debug_msg.key, "md25 in ", 10); @@ -611,8 +607,7 @@ int md25Sine(const char *deviceName, uint8_t bus, uint8_t address) // send output message strncpy(debug_msg.key, "md25 out ", 10); debug_msg.timestamp_ms = 1000*timestamp; - debug_msg.value = current_revolution - prev_revolution; - //debug_msg.value = output_speed_rpm; + debug_msg.value = current_revolution; debug_msg.update(); if (t > t_final) break; |