diff options
author | James Goppert <james.goppert@gmail.com> | 2013-06-29 15:21:17 -0400 |
---|---|---|
committer | James Goppert <james.goppert@gmail.com> | 2013-07-28 00:05:56 -0400 |
commit | f2a0cce958db1c97eb70d43c3151992ccaed4cab (patch) | |
tree | 736291352b3d2f55d0be8ff0da0913ce344520dc /src/drivers | |
parent | e7cc6e71ad5d53d940a0e5c6961e5ea6c3a59e27 (diff) | |
download | px4-firmware-f2a0cce958db1c97eb70d43c3151992ccaed4cab.tar.gz px4-firmware-f2a0cce958db1c97eb70d43c3151992ccaed4cab.tar.bz2 px4-firmware-f2a0cce958db1c97eb70d43c3151992ccaed4cab.zip |
Fixed timing issues.
Diffstat (limited to 'src/drivers')
-rw-r--r-- | src/drivers/md25/md25.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/drivers/md25/md25.cpp b/src/drivers/md25/md25.cpp index 582b871c7..7a1e7b7f4 100644 --- a/src/drivers/md25/md25.cpp +++ b/src/drivers/md25/md25.cpp @@ -577,7 +577,7 @@ int md25Sine(const char *deviceName, uint8_t bus, uint8_t address) md25.setTimeout(true); float dt = 0.1; float amplitude = 0.2; - float omega = 0.1; + float frequency = 0.3; // input signal control::UOrbPublication<debug_key_value_s> input_signal(NULL, @@ -601,9 +601,9 @@ int md25Sine(const char *deviceName, uint8_t bus, uint8_t address) // input uint64_t timestamp = hrt_absolute_time(); - float t = timestamp/1000; + float t = timestamp/1000000; input_signal.timestamp_ms = timestamp; - input_signal.value = amplitude*sinf(omega*t); + input_signal.value = amplitude*sinf(2*M_PI*frequency*t); md25.setMotor1Speed(input_signal.value); input_signal.update(); |