mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
SCRIPT namespace replacements
This commit is contained in:
committed by
Peter Johnson
parent
ae6c043632
commit
9aca8e0fd6
@@ -6,21 +6,21 @@
|
||||
|
||||
#include "wpimath/protobuf/geometry2d.npb.h"
|
||||
|
||||
std::optional<frc::Translation2d> wpi::Protobuf<frc::Translation2d>::Unpack(
|
||||
std::optional<wpi::math::Translation2d> wpi::util::Protobuf<wpi::math::Translation2d>::Unpack(
|
||||
InputStream& stream) {
|
||||
wpi_proto_ProtobufTranslation2d msg;
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
return frc::Translation2d{
|
||||
units::meter_t{msg.x},
|
||||
units::meter_t{msg.y},
|
||||
return wpi::math::Translation2d{
|
||||
wpi::units::meter_t{msg.x},
|
||||
wpi::units::meter_t{msg.y},
|
||||
};
|
||||
}
|
||||
|
||||
bool wpi::Protobuf<frc::Translation2d>::Pack(OutputStream& stream,
|
||||
const frc::Translation2d& value) {
|
||||
bool wpi::util::Protobuf<wpi::math::Translation2d>::Pack(OutputStream& stream,
|
||||
const wpi::math::Translation2d& value) {
|
||||
wpi_proto_ProtobufTranslation2d msg{
|
||||
.x = value.X().value(),
|
||||
.y = value.Y().value(),
|
||||
|
||||
Reference in New Issue
Block a user