Skip to content

Commit

Permalink
fix rate issue #65
Browse files Browse the repository at this point in the history
  • Loading branch information
cosama authored and dawonn committed Jul 14, 2021
1 parent 7081d11 commit 31dc02b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,14 @@ int main(int argc, char *argv[])
uint32_t sn = vs.readSerialNumber();
ROS_INFO("Model Number: %s, Firmware Version: %s", mn.c_str(), fv.c_str());
ROS_INFO("Hardware Revision : %d, Serial Number : %d", hv, sn);
ROS_INFO("Publish Rate: %d Hz", async_output_rate);

// Set the device info for passing to the packet callback function
UserData user_data;
user_data.device_family = vs.determineDeviceFamily();

// Set Data output Freq [Hz]
vs.writeAsyncDataOutputFrequency(async_output_rate);
// Make sure no generic async output is registered
vs.writeAsyncDataOutputType(VNOFF);

// Configure binary output message
BinaryOutputRegister bor(
Expand Down Expand Up @@ -260,8 +261,7 @@ int main(int argc, char *argv[])

vs.writeBinaryOutput1(bor);

// Set Data output Freq [Hz]
vs.writeAsyncDataOutputFrequency(async_output_rate);
// Register async callback function
vs.registerAsyncPacketReceivedHandler(&user_data, BinaryAsyncMessageReceived);

// You spin me right round, baby
Expand Down

0 comments on commit 31dc02b

Please sign in to comment.