Skip to content

Rtuttle/adding surveyor240#70

Closed
rileytuttle-havoc wants to merge 2 commits intobluerobotics:masterfrom
HavocAI:rtuttle/adding_surveyor240
Closed

Rtuttle/adding surveyor240#70
rileytuttle-havoc wants to merge 2 commits intobluerobotics:masterfrom
HavocAI:rtuttle/adding_surveyor240

Conversation

@rileytuttle-havoc
Copy link
Copy Markdown

also needs this ping-protocol pr for help with generation

although halfway through this endeavor I stopped generating the surveyor source files so maybe I dont need the generation fixes.

@@ -0,0 +1,154 @@
#include <ping-message-common.h>
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since I didnt want to continue refactoring the generators to work with the surveyor I just stopped generating and fixed the roughly generated source files. but that means I had to add them to the repo where they normally wouldn't be here.

f.close() No newline at end of file
f.close()

# f = open("%s/ping-device-surveyor240.h" % args.output_directory, "w")
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was trying to generate the files like I'm supposed to at first. but it was harder to refactor the generators so that it worked for everything than it was to just take the generation as rough draft and then turn it off and then fix those files directly

f = open("%s/ping-message-%s.h" % (args.output_directory, definition), "w")
f.write(g.generate(mergedJson["global"][definition], templateFile, {"definition": definition}))
f.close()
if definition in "surveyor240":
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the other devices don't need specific generation for the message header. I needed this one while I was still trying to fix generation the right way but its because the generation created the getMessageAsString helpers and tried to directly print atof_t and float* as strings. also it did not generate atof_t structs so I had to add that.

const auto device_type = static_cast<PingDeviceType>(device.device_information.device_type);
std::cout << "Device detected as: " << PingHelper::nameFromDeviceType(device_type) << std::endl;
PingDeviceTest::test("Device ID", device.device_id != 0, Status::OK);
// PingDeviceTest::test("Device ID", device.device_id != 0, Status::OK);
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure why but the device id comes back as null or nothing. didn't really pursue this.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants