[wpimath] Explicitly export wpimath symbols

Co-authored-by: Tyler Veness <calcmogul@gmail.com>
This commit is contained in:
Thad House
2021-08-20 09:02:01 -07:00
committed by Peter Johnson
parent 161e211734
commit 382deef750
54 changed files with 207 additions and 101 deletions

View File

@@ -4,6 +4,8 @@
#pragma once
#include <wpi/SymbolExports.h>
#include "Transform2d.h"
#include "Translation2d.h"
#include "Twist2d.h"
@@ -17,7 +19,7 @@ namespace frc {
/**
* Represents a 2d pose containing translational and rotational elements.
*/
class Pose2d {
class WPILIB_DLLEXPORT Pose2d {
public:
/**
* Constructs a pose at the origin facing toward the positive X axis.
@@ -171,8 +173,10 @@ class Pose2d {
Rotation2d m_rotation;
};
WPILIB_DLLEXPORT
void to_json(wpi::json& json, const Pose2d& pose);
WPILIB_DLLEXPORT
void from_json(const wpi::json& json, Pose2d& pose);
} // namespace frc

View File

@@ -4,6 +4,8 @@
#pragma once
#include <wpi/SymbolExports.h>
#include "units/angle.h"
namespace wpi {
@@ -16,7 +18,7 @@ namespace frc {
* A rotation in a 2d coordinate frame represented a point on the unit circle
* (cosine and sine).
*/
class Rotation2d {
class WPILIB_DLLEXPORT Rotation2d {
public:
/**
* Constructs a Rotation2d with a default angle of 0 degrees.
@@ -160,8 +162,10 @@ class Rotation2d {
double m_sin = 0;
};
WPILIB_DLLEXPORT
void to_json(wpi::json& json, const Rotation2d& rotation);
WPILIB_DLLEXPORT
void from_json(const wpi::json& json, Rotation2d& rotation);
} // namespace frc

View File

@@ -4,16 +4,18 @@
#pragma once
#include <wpi/SymbolExports.h>
#include "Translation2d.h"
namespace frc {
class Pose2d;
class WPILIB_DLLEXPORT Pose2d;
/**
* Represents a transformation for a Pose2d.
*/
class Transform2d {
class WPILIB_DLLEXPORT Transform2d {
public:
/**
* Constructs the transform that maps the initial pose to the final pose.

View File

@@ -4,6 +4,8 @@
#pragma once
#include <wpi/SymbolExports.h>
#include "Rotation2d.h"
#include "units/length.h"
@@ -21,7 +23,7 @@ namespace frc {
* When the robot is placed on the origin, facing toward the X direction,
* moving forward increases the X, whereas moving to the left increases the Y.
*/
class Translation2d {
class WPILIB_DLLEXPORT Translation2d {
public:
/**
* Constructs a Translation2d with X and Y components equal to zero.
@@ -175,8 +177,10 @@ class Translation2d {
units::meter_t m_y = 0_m;
};
WPILIB_DLLEXPORT
void to_json(wpi::json& json, const Translation2d& state);
WPILIB_DLLEXPORT
void from_json(const wpi::json& json, Translation2d& state);
} // namespace frc

View File

@@ -4,6 +4,8 @@
#pragma once
#include <wpi/SymbolExports.h>
#include "units/angle.h"
#include "units/length.h"
#include "units/math.h"
@@ -16,7 +18,7 @@ namespace frc {
*
* A Twist can be used to represent a difference between two poses.
*/
struct Twist2d {
struct WPILIB_DLLEXPORT Twist2d {
/**
* Linear "dx" component
*/