Fixed timing issues.

This commit is contained in:
James Goppert 2013-06-29 15:21:17 -04:00
parent e7cc6e71ad
commit f2a0cce958
1 changed files with 3 additions and 3 deletions

View File

@ -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();