mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-21 08:14:00 +08:00
Revert "Bypass alignment related copy whenever possible (#1443)"
This reverts commit 235d4f8957ee4566d6217783638fa58a586bb35a. old-commit-hash: d5ca841b0f18d2e707eb1f73afac842ede9be7e8
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
#include "common/messaging.h"
|
||||
#include "common/params.h"
|
||||
#include "common/timing.h"
|
||||
#include "common/messagehelp.h"
|
||||
|
||||
#include "messaging.hpp"
|
||||
#include "locationd_yawrate.h"
|
||||
@@ -106,10 +105,14 @@ int main(int argc, char *argv[]) {
|
||||
int save_counter = 0;
|
||||
while (true){
|
||||
for (auto s : poller->poll(100)){
|
||||
MessageReader amsg = s->receive();
|
||||
if (!amsg) continue;
|
||||
Message * msg = s->receive();
|
||||
|
||||
auto amsg = kj::heapArray<capnp::word>((msg->getSize() / sizeof(capnp::word)) + 1);
|
||||
memcpy(amsg.begin(), msg->getData(), msg->getSize());
|
||||
|
||||
capnp::FlatArrayMessageReader capnp_msg(amsg);
|
||||
cereal::Event::Reader event = capnp_msg.getRoot<cereal::Event>();
|
||||
|
||||
auto event = amsg.getEvent();
|
||||
localizer.handle_log(event);
|
||||
|
||||
auto which = event.which();
|
||||
@@ -169,6 +172,7 @@ int main(int argc, char *argv[]) {
|
||||
});
|
||||
}
|
||||
}
|
||||
delete msg;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user