Skip to content

Commit

Permalink
Add an ifdef for the protobuf version
Browse files Browse the repository at this point in the history
  • Loading branch information
Gold856 committed Jun 23, 2024
1 parent e8c16c7 commit cbe33ff
Show file tree
Hide file tree
Showing 31 changed files with 111 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

#include "frc/controller/proto/ArmFeedforwardProto.h"

#include <wpi/ProtoHelper.h>

#include "controller.pb.h"

google::protobuf::Message* wpi::Protobuf<frc::ArmFeedforward>::New(
google::protobuf::Arena* arena) {
return google::protobuf::Arena::CreateMessage<
wpi::proto::ProtobufArmFeedforward>(arena);
return wpi::CreateMessage<wpi::proto::ProtobufArmFeedforward>(arena);
}

frc::ArmFeedforward wpi::Protobuf<frc::ArmFeedforward>::Unpack(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@

#include "frc/controller/proto/DifferentialDriveWheelVoltagesProto.h"

#include <wpi/ProtoHelper.h>

#include "controller.pb.h"

google::protobuf::Message* wpi::Protobuf<
frc::DifferentialDriveWheelVoltages>::New(google::protobuf::Arena* arena) {
return google::protobuf::Arena::CreateMessage<
wpi::proto::ProtobufDifferentialDriveWheelVoltages>(arena);
return wpi::CreateMessage<wpi::proto::ProtobufDifferentialDriveWheelVoltages>(
arena);
}

frc::DifferentialDriveWheelVoltages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

#include "frc/controller/proto/ElevatorFeedforwardProto.h"

#include <wpi/ProtoHelper.h>

#include "controller.pb.h"

google::protobuf::Message* wpi::Protobuf<frc::ElevatorFeedforward>::New(
google::protobuf::Arena* arena) {
return google::protobuf::Arena::CreateMessage<
wpi::proto::ProtobufElevatorFeedforward>(arena);
return wpi::CreateMessage<wpi::proto::ProtobufElevatorFeedforward>(arena);
}

frc::ElevatorFeedforward wpi::Protobuf<frc::ElevatorFeedforward>::Unpack(
Expand Down
5 changes: 3 additions & 2 deletions wpimath/src/main/native/cpp/geometry/proto/Ellipse2dProto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

#include "frc/geometry/proto/Ellipse2dProto.h"

#include <wpi/ProtoHelper.h>

#include "geometry2d.pb.h"

google::protobuf::Message* wpi::Protobuf<frc::Ellipse2d>::New(
google::protobuf::Arena* arena) {
return google::protobuf::Arena::CreateMessage<wpi::proto::ProtobufEllipse2d>(
arena);
return wpi::CreateMessage<wpi::proto::ProtobufEllipse2d>(arena);
}

frc::Ellipse2d wpi::Protobuf<frc::Ellipse2d>::Unpack(
Expand Down
5 changes: 3 additions & 2 deletions wpimath/src/main/native/cpp/geometry/proto/Pose2dProto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

#include "frc/geometry/proto/Pose2dProto.h"

#include <wpi/ProtoHelper.h>

#include "geometry2d.pb.h"

google::protobuf::Message* wpi::Protobuf<frc::Pose2d>::New(
google::protobuf::Arena* arena) {
return google::protobuf::Arena::CreateMessage<wpi::proto::ProtobufPose2d>(
arena);
return wpi::CreateMessage<wpi::proto::ProtobufPose2d>(arena);
}

frc::Pose2d wpi::Protobuf<frc::Pose2d>::Unpack(
Expand Down
5 changes: 3 additions & 2 deletions wpimath/src/main/native/cpp/geometry/proto/Pose3dProto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

#include "frc/geometry/proto/Pose3dProto.h"

#include <wpi/ProtoHelper.h>

#include "geometry3d.pb.h"

google::protobuf::Message* wpi::Protobuf<frc::Pose3d>::New(
google::protobuf::Arena* arena) {
return google::protobuf::Arena::CreateMessage<wpi::proto::ProtobufPose3d>(
arena);
return wpi::CreateMessage<wpi::proto::ProtobufPose3d>(arena);
}

frc::Pose3d wpi::Protobuf<frc::Pose3d>::Unpack(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

#include "frc/geometry/proto/QuaternionProto.h"

#include <wpi/ProtoHelper.h>

#include "geometry3d.pb.h"

google::protobuf::Message* wpi::Protobuf<frc::Quaternion>::New(
google::protobuf::Arena* arena) {
return google::protobuf::Arena::CreateMessage<wpi::proto::ProtobufQuaternion>(
arena);
return wpi::CreateMessage<wpi::proto::ProtobufQuaternion>(arena);
}

frc::Quaternion wpi::Protobuf<frc::Quaternion>::Unpack(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

#include "frc/geometry/proto/Rectangle2dProto.h"

#include <wpi/ProtoHelper.h>

#include "geometry2d.pb.h"

google::protobuf::Message* wpi::Protobuf<frc::Rectangle2d>::New(
google::protobuf::Arena* arena) {
return google::protobuf::Arena::CreateMessage<
wpi::proto::ProtobufRectangle2d>(arena);
return wpi::CreateMessage<wpi::proto::ProtobufRectangle2d>(arena);
}

frc::Rectangle2d wpi::Protobuf<frc::Rectangle2d>::Unpack(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

#include "frc/geometry/proto/Rotation2dProto.h"

#include <wpi/ProtoHelper.h>

#include "geometry2d.pb.h"

google::protobuf::Message* wpi::Protobuf<frc::Rotation2d>::New(
google::protobuf::Arena* arena) {
return google::protobuf::Arena::CreateMessage<wpi::proto::ProtobufRotation2d>(
arena);
return wpi::CreateMessage<wpi::proto::ProtobufRotation2d>(arena);
}

frc::Rotation2d wpi::Protobuf<frc::Rotation2d>::Unpack(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

#include "frc/geometry/proto/Rotation3dProto.h"

#include <wpi/ProtoHelper.h>

#include "geometry3d.pb.h"

google::protobuf::Message* wpi::Protobuf<frc::Rotation3d>::New(
google::protobuf::Arena* arena) {
return google::protobuf::Arena::CreateMessage<wpi::proto::ProtobufRotation3d>(
arena);
return wpi::CreateMessage<wpi::proto::ProtobufRotation3d>(arena);
}

frc::Rotation3d wpi::Protobuf<frc::Rotation3d>::Unpack(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

#include "frc/geometry/proto/Transform2dProto.h"

#include <wpi/ProtoHelper.h>

#include "geometry2d.pb.h"

google::protobuf::Message* wpi::Protobuf<frc::Transform2d>::New(
google::protobuf::Arena* arena) {
return google::protobuf::Arena::CreateMessage<
wpi::proto::ProtobufTransform2d>(arena);
return wpi::CreateMessage<wpi::proto::ProtobufTransform2d>(arena);
}

frc::Transform2d wpi::Protobuf<frc::Transform2d>::Unpack(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

#include "frc/geometry/proto/Transform3dProto.h"

#include <wpi/ProtoHelper.h>

#include "geometry3d.pb.h"

google::protobuf::Message* wpi::Protobuf<frc::Transform3d>::New(
google::protobuf::Arena* arena) {
return google::protobuf::Arena::CreateMessage<
wpi::proto::ProtobufTransform3d>(arena);
return wpi::CreateMessage<wpi::proto::ProtobufTransform3d>(arena);
}

frc::Transform3d wpi::Protobuf<frc::Transform3d>::Unpack(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

#include "frc/geometry/proto/Translation2dProto.h"

#include <wpi/ProtoHelper.h>

#include "geometry2d.pb.h"

google::protobuf::Message* wpi::Protobuf<frc::Translation2d>::New(
google::protobuf::Arena* arena) {
return google::protobuf::Arena::CreateMessage<
wpi::proto::ProtobufTranslation2d>(arena);
return wpi::CreateMessage<wpi::proto::ProtobufTranslation2d>(arena);
}

frc::Translation2d wpi::Protobuf<frc::Translation2d>::Unpack(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

#include "frc/geometry/proto/Translation3dProto.h"

#include <wpi/ProtoHelper.h>

#include "geometry3d.pb.h"

google::protobuf::Message* wpi::Protobuf<frc::Translation3d>::New(
google::protobuf::Arena* arena) {
return google::protobuf::Arena::CreateMessage<
wpi::proto::ProtobufTranslation3d>(arena);
return wpi::CreateMessage<wpi::proto::ProtobufTranslation3d>(arena);
}

frc::Translation3d wpi::Protobuf<frc::Translation3d>::Unpack(
Expand Down
5 changes: 3 additions & 2 deletions wpimath/src/main/native/cpp/geometry/proto/Twist2dProto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

#include "frc/geometry/proto/Twist2dProto.h"

#include <wpi/ProtoHelper.h>

#include "geometry2d.pb.h"

google::protobuf::Message* wpi::Protobuf<frc::Twist2d>::New(
google::protobuf::Arena* arena) {
return google::protobuf::Arena::CreateMessage<wpi::proto::ProtobufTwist2d>(
arena);
return wpi::CreateMessage<wpi::proto::ProtobufTwist2d>(arena);
}

frc::Twist2d wpi::Protobuf<frc::Twist2d>::Unpack(
Expand Down
5 changes: 3 additions & 2 deletions wpimath/src/main/native/cpp/geometry/proto/Twist3dProto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

#include "frc/geometry/proto/Twist3dProto.h"

#include <wpi/ProtoHelper.h>

#include "geometry3d.pb.h"

google::protobuf::Message* wpi::Protobuf<frc::Twist3d>::New(
google::protobuf::Arena* arena) {
return google::protobuf::Arena::CreateMessage<wpi::proto::ProtobufTwist3d>(
arena);
return wpi::CreateMessage<wpi::proto::ProtobufTwist3d>(arena);
}

frc::Twist3d wpi::Protobuf<frc::Twist3d>::Unpack(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

#include "frc/kinematics/proto/ChassisSpeedsProto.h"

#include <wpi/ProtoHelper.h>

#include "kinematics.pb.h"

google::protobuf::Message* wpi::Protobuf<frc::ChassisSpeeds>::New(
google::protobuf::Arena* arena) {
return google::protobuf::Arena::CreateMessage<
wpi::proto::ProtobufChassisSpeeds>(arena);
return wpi::CreateMessage<wpi::proto::ProtobufChassisSpeeds>(arena);
}

frc::ChassisSpeeds wpi::Protobuf<frc::ChassisSpeeds>::Unpack(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@

#include "frc/kinematics/proto/DifferentialDriveKinematicsProto.h"

#include <wpi/ProtoHelper.h>

#include "kinematics.pb.h"

google::protobuf::Message* wpi::Protobuf<frc::DifferentialDriveKinematics>::New(
google::protobuf::Arena* arena) {
return google::protobuf::Arena::CreateMessage<
wpi::proto::ProtobufDifferentialDriveKinematics>(arena);
return wpi::CreateMessage<wpi::proto::ProtobufDifferentialDriveKinematics>(
arena);
}

frc::DifferentialDriveKinematics
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@

#include "frc/kinematics/proto/DifferentialDriveWheelPositionsProto.h"

#include <wpi/ProtoHelper.h>

#include "kinematics.pb.h"

google::protobuf::Message* wpi::Protobuf<
frc::DifferentialDriveWheelPositions>::New(google::protobuf::Arena* arena) {
return google::protobuf::Arena::CreateMessage<
return wpi::CreateMessage<
wpi::proto::ProtobufDifferentialDriveWheelPositions>(arena);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@

#include "frc/kinematics/proto/DifferentialDriveWheelSpeedsProto.h"

#include <wpi/ProtoHelper.h>

#include "kinematics.pb.h"

google::protobuf::Message* wpi::Protobuf<
frc::DifferentialDriveWheelSpeeds>::New(google::protobuf::Arena* arena) {
return google::protobuf::Arena::CreateMessage<
wpi::proto::ProtobufDifferentialDriveWheelSpeeds>(arena);
return wpi::CreateMessage<wpi::proto::ProtobufDifferentialDriveWheelSpeeds>(
arena);
}

frc::DifferentialDriveWheelSpeeds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

#include "frc/kinematics/proto/MecanumDriveKinematicsProto.h"

#include <wpi/ProtoHelper.h>

#include "kinematics.pb.h"

google::protobuf::Message* wpi::Protobuf<frc::MecanumDriveKinematics>::New(
google::protobuf::Arena* arena) {
return google::protobuf::Arena::CreateMessage<
wpi::proto::ProtobufMecanumDriveKinematics>(arena);
return wpi::CreateMessage<wpi::proto::ProtobufMecanumDriveKinematics>(arena);
}

frc::MecanumDriveKinematics wpi::Protobuf<frc::MecanumDriveKinematics>::Unpack(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@

#include "frc/kinematics/proto/MecanumDriveWheelPositionsProto.h"

#include <wpi/ProtoHelper.h>

#include "kinematics.pb.h"

google::protobuf::Message* wpi::Protobuf<frc::MecanumDriveWheelPositions>::New(
google::protobuf::Arena* arena) {
return google::protobuf::Arena::CreateMessage<
wpi::proto::ProtobufMecanumDriveWheelPositions>(arena);
return wpi::CreateMessage<wpi::proto::ProtobufMecanumDriveWheelPositions>(
arena);
}

frc::MecanumDriveWheelPositions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

#include "frc/kinematics/proto/MecanumDriveWheelSpeedsProto.h"

#include <wpi/ProtoHelper.h>

#include "kinematics.pb.h"

google::protobuf::Message* wpi::Protobuf<frc::MecanumDriveWheelSpeeds>::New(
google::protobuf::Arena* arena) {
return google::protobuf::Arena::CreateMessage<
wpi::proto::ProtobufMecanumDriveWheelSpeeds>(arena);
return wpi::CreateMessage<wpi::proto::ProtobufMecanumDriveWheelSpeeds>(arena);
}

frc::MecanumDriveWheelSpeeds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

#include "frc/kinematics/proto/SwerveModulePositionProto.h"

#include <wpi/ProtoHelper.h>

#include "kinematics.pb.h"

google::protobuf::Message* wpi::Protobuf<frc::SwerveModulePosition>::New(
google::protobuf::Arena* arena) {
return google::protobuf::Arena::CreateMessage<
wpi::proto::ProtobufSwerveModulePosition>(arena);
return wpi::CreateMessage<wpi::proto::ProtobufSwerveModulePosition>(arena);
}

frc::SwerveModulePosition wpi::Protobuf<frc::SwerveModulePosition>::Unpack(
Expand Down
Loading

0 comments on commit cbe33ff

Please sign in to comment.