Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fork Sync: Update from parent repository #48

Merged
merged 21 commits into from
Jan 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
c486972
[wpimath] Make ExponentialProfile.State mutable (#6138)
calcmogul Jan 2, 2024
5c42424
[wpilibj] Remove unused AnalogTriggerException (#6142)
auscompgeek Jan 3, 2024
01fb98b
[docs] Add Missing JNI docs from C++ (NFC) (#6139)
m10653 Jan 3, 2024
25636b7
[build] Remove unnecessary native dependencies in wpilibjExamples (#6…
auscompgeek Jan 3, 2024
73c7d87
[glass] NTStringChooser: Properly set retained (#6144)
PeterJohnson Jan 3, 2024
44db3e0
[sysid] Make constexpr variables outside class scope inline (#6145)
calcmogul Jan 3, 2024
4ac0720
[build] Clean up CMake files (#6141)
Gold856 Jan 4, 2024
6e58db3
[commands] Make Java fields private (#6148)
calcmogul Jan 4, 2024
f29a7d2
[docs] Add missing JavaDocs (#6146)
calcmogul Jan 4, 2024
0f060af
[ntcore] Disable WebSocket fragmentation (#6149)
PeterJohnson Jan 4, 2024
4210f56
[docs] Fix warnings about undocumented default constructors (#6151)
calcmogul Jan 4, 2024
13f4460
[docs] Add missing docs to enum fields (NFC) (#6150)
m10653 Jan 5, 2024
19cb2a8
[wpilibj] Make class variables private to match C++ (#6153)
calcmogul Jan 5, 2024
106518c
[docs] Fix wpilibj JavaDoc warnings (#6154)
calcmogul Jan 5, 2024
3e40b9e
[wpilib] Correct SmartDashboard usage reporting (#6157)
Starlight220 Jan 5, 2024
707cb06
[wpilib] Add SysIdRoutine logging utility and command factory (#6033)
Oblarg Jan 5, 2024
4595f84
[wpilib] Report LiveWindow-enabled-in-test (#6158)
Starlight220 Jan 5, 2024
6bed82a
[wpilibc] Clean up C++ SysId routine (#6160)
calcmogul Jan 5, 2024
f94e3d8
[docs] Fix SysId routine JavaDoc warnings (#6159)
calcmogul Jan 6, 2024
7c26bc7
[sysid] Load DataLog files directly for analysis (#6103)
PeterJohnson Jan 6, 2024
0a46a3a
[wpilib] Make ADXL345 default I2C address public (#6163)
calcmogul Jan 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
if("${isSystemDir}" STREQUAL "-1")
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
endif("${isSystemDir}" STREQUAL "-1")
endif()

# Options for building certain parts of the repo. Everything is built by default.
option(BUILD_SHARED_LIBS "Build with shared libs (needed for JNI)" ON)
Expand Down Expand Up @@ -214,7 +214,6 @@ endif()
find_package(LIBSSH 0.7.1)

find_package(Protobuf REQUIRED)
find_program(Quickbuf_EXECUTABLE NAMES protoc-gen-quickbuf DOC "The Quickbuf protoc plugin")

set(APRILTAG_DEP_REPLACE "find_dependency(apriltag)")
set(CAMERASERVER_DEP_REPLACE_IMPL "find_dependency(cameraserver)")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,21 @@ public static class Config {
*/
public boolean debug;

/** Default constructor. */
public Config() {}

/**
* Constructs a detector configuration.
*
* @param numThreads How many threads should be used for computation.
* @param quadDecimate Quad decimation.
* @param quadSigma What Gaussian blur should be applied to the segmented image (used for quad
* detection).
* @param refineEdges When true, the edges of the each quad are adjusted to "snap to" strong
* gradients nearby.
* @param decodeSharpening How much sharpening should be done to decoded images.
* @param debug Debug mode.
*/
Config(
int numThreads,
float quadDecimate,
Expand Down Expand Up @@ -139,8 +152,21 @@ public static class QuadThresholdParameters {
*/
public boolean deglitch;

/** Default constructor. */
public QuadThresholdParameters() {}

/**
* Constructs quad threshold parameters.
*
* @param minClusterPixels Threshold used to reject quads containing too few pixels.
* @param maxNumMaxima How many corner candidates to consider when segmenting a group of pixels
* into a quad.
* @param criticalAngle Critical angle, in radians.
* @param maxLineFitMSE When fitting lines to the contours, the maximum mean squared error
* allowed.
* @param minWhiteBlackDiff Minimum brightness offset.
* @param deglitch Whether the thresholded image be should be deglitched.
*/
QuadThresholdParameters(
int minClusterPixels,
int maxNumMaxima,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonAutoDetect(getterVisibility = JsonAutoDetect.Visibility.NONE)
public class AprilTagFieldLayout {
/** Common origin positions for the AprilTag coordinate system. */
public enum OriginPosition {
/** Blue alliance wall, right side. */
kBlueAllianceWallRightSide,
/** Red alliance wall, right side. */
kRedAllianceWallRightSide,
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,20 @@
import java.io.IOException;
import java.io.UncheckedIOException;

/** Loadable AprilTag field layouts. */
public enum AprilTagFields {
/** 2022 Rapid React. */
k2022RapidReact("2022-rapidreact.json"),
/** 2023 Charged Up. */
k2023ChargedUp("2023-chargedup.json");

/** Base resource directory. */
public static final String kBaseResourceDir = "/edu/wpi/first/apriltag/";

/** Alias to the current game. */
public static final AprilTagFields kDefaultField = k2023ChargedUp;

/** Resource filename. */
public final String m_resourceFile;

AprilTagFields(String resourceFile) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,19 @@ public Config(double tagSize, double fx, double fy, double cx, double cy) {
this.cy = cy;
}

/** Tag size, in meters. */
public double tagSize;

/** Camera horizontal focal length, in pixels. */
public double fx;

/** Camera vertical focal length, in pixels. */
public double fy;

/** Camera horizontal focal center, in pixels. */
public double cx;

/** Camera vertical focal center, in pixels. */
public double cy;

@Override
Expand Down
14 changes: 14 additions & 0 deletions apriltag/src/main/java/edu/wpi/first/apriltag/jni/AprilTagJNI.java
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,22 @@ public static native Transform3d estimatePose(
double cx,
double cy);

/**
* Generates a RawFrame containing the apriltag with the id with family 16h5 passed in.
*
* @param frameObj generated frame (output parameter).
* @param frame raw frame handle
* @param id id
*/
public static native void generate16h5AprilTagImage(RawFrame frameObj, long frame, int id);

/**
* Generates a RawFrame containing the apriltag with the id with family 36h11 passed in.
*
* @param frameObj generated frame (output parameter).
* @param frame raw frame handle
* @param id id
*/
public static native void generate36h11AprilTagImage(RawFrame frameObj, long frame, int id);

/** Utility class. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,13 @@ namespace frc {
* towards the opposing alliance). */
class WPILIB_DLLEXPORT AprilTagFieldLayout {
public:
/**
* Common origin positions for the AprilTag coordinate system.
*/
enum class OriginPosition {
/// Blue alliance wall, right side.
kBlueAllianceWallRightSide,
/// Red alliance wall, right side.
kRedAllianceWallRightSide,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@

namespace frc {

/**
* Loadable AprilTag field layouts.
*/
enum class AprilTagField {
/// 2022 Rapid React.
k2022RapidReact,
/// 2023 Charged Up.
k2023ChargedUp,

// This is a placeholder for denoting the last supported field. This should
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
* NetworkTables.
*/
public final class CameraServer {
/** CameraServer base port. */
public static final int kBasePort = 1181;

private static final String kPublishName = "/CameraPublisher";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package edu.wpi.first.cameraserver;

/** CameraServer shared functions. */
public interface CameraServerShared {
/**
* get the main thread id func.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package edu.wpi.first.cameraserver;

/** Storage for CameraServerShared instance. */
public final class CameraServerSharedStore {
private static CameraServerShared cameraServerShared;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ namespace frc {
*/
class CameraServer {
public:
/// CameraServer base port.
static constexpr uint16_t kBasePort = 1181;
static constexpr int kSize640x480 = 0;
static constexpr int kSize320x240 = 1;
static constexpr int kSize160x120 = 2;

/**
* Start automatically capturing images to send to the dashboard.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,9 @@ public static native VideoEvent[] pollListenerTimeout(int poller, double timeout
// Telemetry Functions
//
public enum TelemetryKind {
/** kSourceBytesReceived. */
kSourceBytesReceived(1),
/** kSourceFramesReceived. */
kSourceFramesReceived(2);

private final int value;
Expand Down
4 changes: 4 additions & 0 deletions cscore/src/main/java/edu/wpi/first/cscore/HttpCamera.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@
/** A source that represents a MJPEG-over-HTTP (IP) camera. */
public class HttpCamera extends VideoCamera {
public enum HttpCameraKind {
/** Unknown camera kind. */
kUnknown(0),
/** MJPG Streamer camera. */
kMJPGStreamer(1),
/** CS Core camera. */
kCSCore(2),
/** Axis camera. */
kAxis(3);

private final int value;
Expand Down
3 changes: 3 additions & 0 deletions cscore/src/main/java/edu/wpi/first/cscore/VideoCamera.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ public static class WhiteBalance {
public static final int kFixedOutdoor2 = 5000;
public static final int kFixedFluorescent1 = 5100;
public static final int kFixedFlourescent2 = 5200;

/** Default constructor. */
public WhiteBalance() {}
}

protected VideoCamera(int handle) {
Expand Down
21 changes: 21 additions & 0 deletions cscore/src/main/java/edu/wpi/first/cscore/VideoEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,47 @@
@SuppressWarnings("MemberName")
public class VideoEvent {
public enum Kind {
/** Unknown video event. */
kUnknown(0x0000),
/** Source Created event. */
kSourceCreated(0x0001),
/** Source Destroyed event. */
kSourceDestroyed(0x0002),
/** Source Connected event. */
kSourceConnected(0x0004),
/** Source Disconnected event. */
kSourceDisconnected(0x0008),
/** Source Video Modes Updated event. */
kSourceVideoModesUpdated(0x0010),
/** Source VideoMode Changed event. */
kSourceVideoModeChanged(0x0020),
/** Source Property Created event. */
kSourcePropertyCreated(0x0040),
/** Source Property Value Updated event. */
kSourcePropertyValueUpdated(0x0080),
/** Source Property Choices Updated event. */
kSourcePropertyChoicesUpdated(0x0100),
/** Sink Source Changed event. */
kSinkSourceChanged(0x0200),
/** Sink Created event. */
kSinkCreated(0x0400),
/** Sink Destroyed event. */
kSinkDestroyed(0x0800),
/** Sink Enabled event. */
kSinkEnabled(0x1000),
/** Sink Disabled event. */
kSinkDisabled(0x2000),
/** Network Interfaces Changed event. */
kNetworkInterfacesChanged(0x4000),
/** Telemetry Updated event. */
kTelemetryUpdated(0x8000),
/** Sink Property Created event. */
kSinkPropertyCreated(0x10000),
/** Sink Property Value Updated event. */
kSinkPropertyValueUpdated(0x20000),
/** Sink Property Choices Updated event. */
kSinkPropertyChoicesUpdated(0x40000),
/** Usb Cameras Changed event. */
kUsbCamerasChanged(0x80000);

private final int value;
Expand Down
6 changes: 6 additions & 0 deletions cscore/src/main/java/edu/wpi/first/cscore/VideoProperty.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,17 @@

/** A source or sink property. */
public class VideoProperty {
/** VideoProperty property types. */
public enum Kind {
/** No specific property. */
kNone(0),
/** Boolean property. */
kBoolean(1),
/** Integer property. */
kInteger(2),
/** String property. */
kString(4),
/** Enum property. */
kEnum(8);

private final int value;
Expand Down
5 changes: 5 additions & 0 deletions cscore/src/main/java/edu/wpi/first/cscore/VideoSink.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@
* (e.g. from a stereo or depth camera); these are called channels.
*/
public class VideoSink implements AutoCloseable {
/** Video sink types. */
public enum Kind {
/** Unknown video sink type. */
kUnknown(0),
/** MJPEG video sink. */
kMjpeg(2),
/** CV video sink. */
kCv(4),
/** Raw video sink. */
kRaw(8);

private final int value;
Expand Down
5 changes: 5 additions & 0 deletions cscore/src/main/java/edu/wpi/first/cscore/VideoSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@
*/
public class VideoSource implements AutoCloseable {
public enum Kind {
/** Unknown video source. */
kUnknown(0),
/** USB video source. */
kUsb(1),
/** HTTP video source. */
kHttp(2),
/** CV video source. */
kCv(4),
/** Raw video source. */
kRaw(8);

private final int value;
Expand Down
16 changes: 16 additions & 0 deletions cscore/src/main/native/include/cscore_oo.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,15 @@ class VideoProperty {

public:
enum Kind {
/// No specific property.
kNone = CS_PROP_NONE,
/// Boolean property.
kBoolean = CS_PROP_BOOLEAN,
/// Integer property.
kInteger = CS_PROP_INTEGER,
/// String property.
kString = CS_PROP_STRING,
/// Enum property.
kEnum = CS_PROP_ENUM
};

Expand Down Expand Up @@ -100,9 +105,13 @@ class VideoSource {

public:
enum Kind {
/// Unknown video source.
kUnknown = CS_SOURCE_UNKNOWN,
/// USB video source.
kUsb = CS_SOURCE_USB,
/// HTTP video source.
kHttp = CS_SOURCE_HTTP,
/// CV video source.
kCv = CS_SOURCE_CV
};

Expand Down Expand Up @@ -471,9 +480,13 @@ class UsbCamera : public VideoCamera {
class HttpCamera : public VideoCamera {
public:
enum HttpCameraKind {
/// Unknown camera kind.
kUnknown = CS_HTTP_UNKNOWN,
/// MJPG Streamer camera.
kMJPGStreamer = CS_HTTP_MJPGSTREAMER,
/// CS Core camera.
kCSCore = CS_HTTP_CSCORE,
/// Axis camera.
kAxis = CS_HTTP_AXIS
};

Expand Down Expand Up @@ -716,8 +729,11 @@ class VideoSink {

public:
enum Kind {
/// Unknown sink type.
kUnknown = CS_SINK_UNKNOWN,
/// MJPEG video sink.
kMjpeg = CS_SINK_MJPEG,
/// CV video sink.
kCv = CS_SINK_CV
};

Expand Down
2 changes: 1 addition & 1 deletion datalogtool/src/main/generate/WPILibVersion.cpp.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* Autogenerated file! Do not manually edit this file. This version is regenerated
* any time the publish task is run, or when this file is deleted.
*/
Expand Down
Loading