mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-06 03:31:43 +00:00
Compare commits
83 Commits
jenkins-re
...
jenkins-re
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
93100c0e67 | ||
|
|
b80565d065 | ||
|
|
2d45cda74b | ||
|
|
e4d90c6cbe | ||
|
|
18bdb7fdec | ||
|
|
f6e8db50f8 | ||
|
|
20c60a5fe6 | ||
|
|
66b7a8b66e | ||
|
|
8ebf88b741 | ||
|
|
b85b0c8eb2 | ||
|
|
c58fde19f9 | ||
|
|
003dc0dc2b | ||
|
|
26419ec209 | ||
|
|
3834393698 | ||
|
|
97be9765cd | ||
|
|
0881ac0b24 | ||
|
|
1b7e5970f9 | ||
|
|
bc84c7ac7c | ||
|
|
fc34b9b803 | ||
|
|
9af070a4af | ||
|
|
93925bc025 | ||
|
|
132804a4ce | ||
|
|
9e6d683671 | ||
|
|
f7e8b95a24 | ||
|
|
213e73c43e | ||
|
|
455654a95b | ||
|
|
261b1857cd | ||
|
|
f3fe64a60e | ||
|
|
f108853e1b | ||
|
|
a56c0eb4af | ||
|
|
8c01e9065a | ||
|
|
be30d3ab1d | ||
|
|
53255a764f | ||
|
|
3abd352be9 | ||
|
|
70be534fe0 | ||
|
|
e677d52a21 | ||
|
|
62790c0f47 | ||
|
|
cd75dc71e8 | ||
|
|
a381b60e32 | ||
|
|
311a690262 | ||
|
|
a2f015c25b | ||
|
|
5c26b37d3b | ||
|
|
8dba364bef | ||
|
|
76f9b3bbc2 | ||
|
|
bbeb0084a2 | ||
|
|
e51c3daf00 | ||
|
|
dc89ec673a | ||
|
|
fc7c015823 | ||
|
|
c52e29432c | ||
|
|
53d50f470a | ||
|
|
ca303e0169 | ||
|
|
042a1dbc82 | ||
|
|
3c91de56d3 | ||
|
|
0c2f3c19cc | ||
|
|
023d20abc1 | ||
|
|
5c702edd8f | ||
|
|
d90bbc195c | ||
|
|
3365d0dc18 | ||
|
|
615d62a219 | ||
|
|
78988584e3 | ||
|
|
294e224fcd | ||
|
|
436c92961b | ||
|
|
341abbfaaf | ||
|
|
eab34bbb88 | ||
|
|
5db5320793 | ||
|
|
54eaa913f6 | ||
|
|
8a541a67ca | ||
|
|
7fa0eea492 | ||
|
|
cc431354b7 | ||
|
|
65c10cd469 | ||
|
|
fea52a77a3 | ||
|
|
4e31b68008 | ||
|
|
f99b57b1fe | ||
|
|
dad3b68f36 | ||
|
|
08c8723174 | ||
|
|
ce768ae341 | ||
|
|
217c50c28f | ||
|
|
fcc8230dbf | ||
|
|
d2c1bc174f | ||
|
|
6fe638e977 | ||
|
|
07837c4ab4 | ||
|
|
daee45780d | ||
|
|
887a4e94f3 |
@@ -6,12 +6,12 @@
|
||||
provider-name="Worcester Polytechnic Institute">
|
||||
|
||||
<copyright>
|
||||
* Copyright (c) 2013 FIRST and WPI
|
||||
* Copyright (c) 2015 FIRST and WPI
|
||||
* All rights reserved.
|
||||
</copyright>
|
||||
|
||||
<license>
|
||||
* Copyright (c) 2013 FIRST and WPI
|
||||
* Copyright (c) 2015 FIRST and WPI
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
|
||||
@@ -23,7 +23,7 @@ Require-Bundle: org.eclipse.ui,
|
||||
org.eclipse.ui.intro,
|
||||
org.eclipse.ui.intro.universal,
|
||||
org.eclipse.core.expressions;bundle-version="3.4.400",
|
||||
org.eclipse.core.variables;bundle-version="3.2.700"
|
||||
org.eclipse.core.variables
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
|
||||
Export-Package: edu.wpi.first.wpilib.plugins.core,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>edu.wpi.first.wpilib.plugins.core</artifactId>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
@@ -11,4 +11,188 @@
|
||||
<version>0.1.0.qualifier</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<build-number>DEVELOPMENT</build-number>
|
||||
<tools-zip>${project.build.directory}/tools-zip</tools-zip>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>WPILib Maven Repository</id>
|
||||
<url>http://first.wpi.edu/FRC/roborio/maven/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>.</directory>
|
||||
<includes>
|
||||
<include>resources/configuration.properties</include>
|
||||
</includes>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.6</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-ant-resources-to-tools-zip</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${tools-zip}</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources/tools-zip</directory>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>2.8</version>
|
||||
<executions>
|
||||
|
||||
<!-- Fetch the dependencies needed to build the jar.zip file. -->
|
||||
<execution>
|
||||
<id>fetch-jar-zip-dependencies</id>
|
||||
<phase>compile</phase>
|
||||
<goals>
|
||||
<goal>copy</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>edu.wpi.first.wpilib</groupId>
|
||||
<artifactId>RobotBuilder</artifactId>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
<outputDirectory>${tools-zip}</outputDirectory>
|
||||
<destFileName>RobotBuilder.jar</destFileName>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>edu.wpi.first.wpilib</groupId>
|
||||
<artifactId>SmartDashboard</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<outputDirectory>${tools-zip}</outputDirectory>
|
||||
<destFileName>SmartDashboard.jar</destFileName>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
|
||||
<overWriteReleases>false</overWriteReleases>
|
||||
<overWriteSnapshots>true</overWriteSnapshots>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<version>1.7</version>
|
||||
<executions>
|
||||
|
||||
<!-- Set time stamp and version properties. -->
|
||||
<execution>
|
||||
<id>set-version-info</id>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<phase>process-sources</phase>
|
||||
<configuration>
|
||||
<target>
|
||||
<tstamp>
|
||||
<format property="timestamp" pattern="yyyy/MM/dd HH:mm:ss z"/>
|
||||
</tstamp>
|
||||
<tstamp>
|
||||
<format property="version-info" pattern="yyyy.MM.dd.HH.mm.ss"/>
|
||||
</tstamp>
|
||||
<property name="version" value="${version-info}.${build-number}"/>
|
||||
</target>
|
||||
<exportAntProperties>true</exportAntProperties>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
||||
<!-- Generate zip file to unzip for the user. -->
|
||||
<execution>
|
||||
<id>generate-jar-zip</id>
|
||||
<phase>compile</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<target>
|
||||
<zip destfile="${project.build.directory}/classes/resources/tools.zip"
|
||||
basedir="${tools-zip}"
|
||||
update="true" />
|
||||
</target>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
|
||||
<plugin>
|
||||
<groupId>org.eclipse.m2e</groupId>
|
||||
<artifactId>lifecycle-mapping</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<configuration>
|
||||
<lifecycleMappingMetadata>
|
||||
<pluginExecutions>
|
||||
<pluginExecution>
|
||||
<pluginExecutionFilter>
|
||||
<groupId>
|
||||
org.apache.maven.plugins
|
||||
</groupId>
|
||||
<artifactId>
|
||||
maven-dependency-plugin
|
||||
</artifactId>
|
||||
<versionRange>[2.8,)</versionRange>
|
||||
<goals>
|
||||
<goal>copy</goal>
|
||||
</goals>
|
||||
</pluginExecutionFilter>
|
||||
<action>
|
||||
<ignore/>
|
||||
</action>
|
||||
</pluginExecution>
|
||||
</pluginExecutions>
|
||||
</lifecycleMappingMetadata>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
<!-- Add fake dependencies to inform Maven of the correct
|
||||
order it should build projects in during a multi-module build.
|
||||
|
||||
This list should match the list in the invocation of
|
||||
maven-dependency-plugin:copy above.
|
||||
|
||||
It may be possible to avoid this duplication by using the
|
||||
maven-assembly-plugin instead.-->
|
||||
|
||||
<!-- Library sources for debugging WPILib on the Athena -->
|
||||
<dependency>
|
||||
<groupId>edu.wpi.first.wpilib</groupId>
|
||||
<artifactId>RobotBuilder</artifactId>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>edu.wpi.first.wpilib</groupId>
|
||||
<artifactId>SmartDashboard</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
timestamp=${timestamp}
|
||||
version=${version}
|
||||
Binary file not shown.
@@ -134,7 +134,17 @@ public class WPILibCore extends AbstractUIPlugin {
|
||||
}
|
||||
|
||||
public String getDefaultVersion() {
|
||||
return "0.2";
|
||||
try {
|
||||
Properties props = new AntPropertiesParser(WPILibCore.class.getResourceAsStream("/resources/configuration.properties")).getProperties();
|
||||
if (props.getProperty("version").startsWith("$")) {
|
||||
return "DEVELOPMENT";
|
||||
} else {
|
||||
return props.getProperty("version");
|
||||
}
|
||||
} catch (CoreException e) {
|
||||
WPILibCore.logError("Error getting properties.", e);
|
||||
return "DEVELOPMENT";
|
||||
}
|
||||
}
|
||||
|
||||
public String getCurrentVersion() {
|
||||
|
||||
@@ -98,18 +98,19 @@ public class NewProjectMainPage extends WizardPage {
|
||||
groupLayout.numColumns = 1;
|
||||
projectTypeGroup.setLayout(groupLayout);
|
||||
|
||||
commandRobot = new Button(projectTypeGroup, SWT.RADIO | SWT.WRAP);
|
||||
commandRobot.setText("Command-Based Robot: A robot project that allows robots to be implemented using the command based model to allow complex functionality to be developed from simpler functionality.");
|
||||
gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||
gd.widthHint = 300;
|
||||
commandRobot.setLayoutData(gd);
|
||||
commandRobot.setSelection(true);
|
||||
|
||||
iterativeRobot = new Button(projectTypeGroup, SWT.RADIO | SWT.WRAP);
|
||||
iterativeRobot.setText("Iterative Robot: A robot project that allows robots to be implemented in an iterative manner.");
|
||||
gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||
gd.widthHint = 300;
|
||||
iterativeRobot.setLayoutData(gd);
|
||||
|
||||
commandRobot = new Button(projectTypeGroup, SWT.RADIO | SWT.WRAP);
|
||||
commandRobot.setText("Command-Based Robot: A robot project that allows robots to be implemented using the command based model to allow complex functionality to be developed from simpler functionality.");
|
||||
gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||
gd.widthHint = 300;
|
||||
commandRobot.setLayoutData(gd);
|
||||
|
||||
sampleRobot = new Button(projectTypeGroup, SWT.RADIO | SWT.WRAP);
|
||||
sampleRobot.setText("Sample Robot: A robot project used for small sample programs or for highly advanced programs with more complete control over program flow");
|
||||
gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||
|
||||
@@ -21,6 +21,8 @@ import org.eclipse.core.resources.ResourcesPlugin;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
|
||||
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
|
||||
|
||||
@@ -79,8 +81,14 @@ public class ProjectCreationUtils {
|
||||
} catch (CoreException e) {
|
||||
WPILibCore.logError("Can't create new project.", e);
|
||||
}
|
||||
}else {
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
MessageDialog.openError(Display.getDefault().getActiveShell(), "Error", "Error! A project of the same name already exists in the Workspace");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return newProject;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
</description>
|
||||
|
||||
<copyright>
|
||||
* Copyright (c) 2013 FIRST and WPI
|
||||
* Copyright (c) 2015 FIRST and WPI
|
||||
* All rights reserved.
|
||||
</copyright>
|
||||
|
||||
<license>
|
||||
* Copyright (c) 2013 FIRST and WPI
|
||||
* Copyright (c) 2015 FIRST and WPI
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
<format property="timestamp" pattern="yyyy/MM/dd HH:mm:ss z"/>
|
||||
</tstamp>
|
||||
<tstamp>
|
||||
<format property="version-info" pattern="yyyy.MM"/>
|
||||
<format property="version-info" pattern="yyyy.MM.dd.HH.mm.ss"/>
|
||||
</tstamp>
|
||||
<property name="version" value="${version-info}.${build-number}"/>
|
||||
</target>
|
||||
|
||||
@@ -15,6 +15,11 @@ private:
|
||||
autonomousCommand = new ExampleCommand();
|
||||
lw = LiveWindow::GetInstance();
|
||||
}
|
||||
|
||||
void DisabledPeriodic()
|
||||
{
|
||||
Scheduler::GetInstance()->Run();
|
||||
}
|
||||
|
||||
void AutonomousInit()
|
||||
{
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
#include "WPILib.h"
|
||||
|
||||
/**
|
||||
* This is a sample program showing how to retrieve information from
|
||||
* the Power Distribution Panel via CAN.
|
||||
* The information will be displayed under variables through the SmartDashboard.
|
||||
*/
|
||||
class Robot: public SampleRobot
|
||||
{
|
||||
|
||||
// Object for dealing with the Power Distribution Panel (PDP).
|
||||
PowerDistributionPanel m_pdp;
|
||||
|
||||
// Update every 5milliseconds/0.005 seconds.
|
||||
const double kUpdatePeriod = 0.005;
|
||||
|
||||
public:
|
||||
Robot() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve information from the PDP over CAN and
|
||||
* displays it on the SmartDashboard interface.
|
||||
* SmartDashboard::PutNumber takes a string (for a label) and a double;
|
||||
* GetCurrent takes a channel number and returns a double for current,
|
||||
* in Amperes. Channel numbers are printed on the PDP and range from 0-15.
|
||||
*/
|
||||
void OperatorControl()
|
||||
{
|
||||
while (IsOperatorControl())
|
||||
{
|
||||
// Get the current going through channel 7, in Amperes.
|
||||
// The PDP returns the current in increments of 0.125A.
|
||||
// At low currents the current readings tend to be less accurate.
|
||||
SmartDashboard::PutNumber("Current Channel 7", m_pdp.GetCurrent(7));
|
||||
// Get the voltage going into the PDP, in Volts.
|
||||
// The PDP returns the voltage in increments of 0.05 Volts.
|
||||
SmartDashboard::PutNumber("Voltage", m_pdp.GetVoltage());
|
||||
// Retrieves the temperature of the PDP, in degrees Celsius.
|
||||
SmartDashboard::PutNumber("Temperature", m_pdp.GetTemperature());
|
||||
Wait(kUpdatePeriod);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
START_ROBOT_CLASS(Robot);
|
||||
@@ -0,0 +1,82 @@
|
||||
#include "WPILib.h"
|
||||
|
||||
/**
|
||||
* Sample program displaying the value of a quadrature encoder on the SmartDashboard.
|
||||
* Quadrature Encoders are digital sensors which can detect the amount the encoder
|
||||
* has rotated since starting as well as the direction in which the encoder
|
||||
* shaft is rotating. However, encoders can not tell you the absolute
|
||||
* position of the encoder shaft (ie, it considers where it starts to be the
|
||||
* zero position, no matter where it starts), and so can only tell you how
|
||||
* much the encoder has rotated since starting.
|
||||
* Depending on the precision of an encoder, it will have fewer or greater
|
||||
* ticks per revolution; the number of ticks per revolution will affect the
|
||||
* conversion between ticks and distance, as specified by DistancePerPulse.
|
||||
* One of the most common uses of encoders is in the drivetrain, so that the
|
||||
* distance that the robot drives can be precisely controlled during the
|
||||
* autonomous mode.
|
||||
*/
|
||||
class Robot: public SampleRobot
|
||||
{
|
||||
Encoder m_encoder;
|
||||
|
||||
/**
|
||||
* Time to wait between updating SmartDashboard values.
|
||||
* It is generally a good idea to stick a short wait in these loops
|
||||
* to avoid hogging CPU power, especially as there will be no
|
||||
* perceivable difference in the SmartDashboard display.
|
||||
*/
|
||||
const double kUpdatePeriod = 0.005; // 5milliseconds / 0.005 seconds.
|
||||
|
||||
public:
|
||||
/**
|
||||
* The Encoder object is constructed with 4 parameters, the last two being optional.
|
||||
* The first two parameters (1, 2 in this case) refer to the ports on the
|
||||
* roboRIO which the encoder uses. Because a quadrature encoder has
|
||||
* two signal wires, the signal from two DIO ports on the roboRIO are used.
|
||||
* The third (optional) parameter is a boolean which defaults to false.
|
||||
* If you set this parameter to true, the direction of the encoder will
|
||||
* be reversed, in case it makes more sense mechanically.
|
||||
* The final (optional) parameter specifies encoding rate (k1X, k2X, or k4X)
|
||||
* and defaults to k4X. Faster (k4X) encoding gives greater positional
|
||||
* precision but more noise in the rate.
|
||||
*/
|
||||
Robot() : m_encoder(1, 2, false, Encoder::k4X)
|
||||
{
|
||||
// Defines the number of samples to average when determining the rate.
|
||||
// On a quadrature encoder, values range from 1-255; larger values
|
||||
// result in smoother but potentially less accurate rates than lower values.
|
||||
m_encoder.SetSamplesToAverage(5);
|
||||
|
||||
// Defines how far the mechanism attached to the encoder moves per pulse.
|
||||
// In this case, we assume that a 360 count encoder is directly attached
|
||||
// to a 3 inch diameter (1.5inch radius) wheel, and that we want to
|
||||
// measure distance in inches.
|
||||
m_encoder.SetDistancePerPulse(1.0 / 360.0 * 2.0 * 3.1415 * 1.5);
|
||||
|
||||
// Defines the lowest rate at which the encoder will not be considered
|
||||
// stopped, for the purposes of the GetStopped() method.
|
||||
// Units are in distance / second, where distance refers to the units
|
||||
// of distance that you are using, in this case inches.
|
||||
m_encoder.SetMinRate(1.0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve various information from the encoder and display it
|
||||
* on the SmartDashboard.
|
||||
*/
|
||||
void OperatorControl()
|
||||
{
|
||||
while (IsOperatorControl())
|
||||
{
|
||||
// Retrieve the net displacement of the Encoder since the lsat Reset.
|
||||
SmartDashboard::PutNumber("Encoder Distance", m_encoder.GetDistance());
|
||||
|
||||
// Retrieve the current rate of the encoder.
|
||||
SmartDashboard::PutNumber("Encoder Rate", m_encoder.GetRate());
|
||||
|
||||
Wait(kUpdatePeriod); // Wait a short bit before updating again.
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
START_ROBOT_CLASS(Robot);
|
||||
@@ -0,0 +1,44 @@
|
||||
#include "WPILib.h"
|
||||
|
||||
/**
|
||||
* This sample program shows how to control a motor using a joystick. In the operator
|
||||
* control part of the program, the joystick is read and the value is written to the motor.
|
||||
*
|
||||
* Joystick analog values range from -1 to 1 and speed controller inputs as range from
|
||||
* -1 to 1 making it easy to work together. The program also delays a short time in the loop
|
||||
* to allow other threads to run. This is generally a good idea, especially since the joystick
|
||||
* values are only transmitted from the Driver Station once every 20ms.
|
||||
*/
|
||||
class Robot : public SampleRobot {
|
||||
Joystick m_stick;
|
||||
|
||||
// The motor to control with the Joystick.
|
||||
// This uses a Talon speed controller; use the Victor or Jaguar classes for
|
||||
// other speed controllers.
|
||||
Talon m_motor;
|
||||
|
||||
// update every 0.005 seconds/5 milliseconds.
|
||||
double kUpdatePeriod = 0.005;
|
||||
|
||||
public:
|
||||
Robot() :
|
||||
m_stick(0), // Initialize Joystick on port 0.
|
||||
m_motor(0) // Initialize the Talon on channel 0.
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs the motor from the output of a Joystick.
|
||||
*/
|
||||
void OperatorControl() {
|
||||
while (IsOperatorControl()) {
|
||||
// Set the motor controller's output.
|
||||
// This takes a number from -1 (100% speed in reverse) to +1 (100% speed forwards).
|
||||
m_motor.Set(m_stick.GetY());
|
||||
|
||||
Wait(kUpdatePeriod); // Wait 5ms for the next update.
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
START_ROBOT_CLASS(Robot);
|
||||
@@ -0,0 +1,55 @@
|
||||
#include "WPILib.h"
|
||||
|
||||
/**
|
||||
* This sample program shows how to control a motor using a joystick. In the operator
|
||||
* control part of the program, the joystick is read and the value is written to the motor.
|
||||
* An Encoder is then used to read the total distance that the motor has turned and
|
||||
* to display it on the SmartDashboard.
|
||||
*
|
||||
* Joystick analog values range from -1 to 1 and speed controller inputs as range from
|
||||
* -1 to 1 making it easy to work together. The program also delays a short time in the loop
|
||||
* to allow other threads to run. This is generally a good idea, especially since the joystick
|
||||
* values are only transmitted from the Driver Station once every 20ms.
|
||||
*/
|
||||
class Robot : public SampleRobot {
|
||||
Joystick m_stick;
|
||||
|
||||
// The motor to control with the Joystick.
|
||||
// This uses a Talon speed controller; use the Victor or Jaguar classes for
|
||||
// other speed controllers.
|
||||
Talon m_motor;
|
||||
|
||||
// update every 0.005 seconds/5 milliseconds.
|
||||
double kUpdatePeriod = 0.005;
|
||||
|
||||
Encoder m_encoder;
|
||||
|
||||
public:
|
||||
Robot() :
|
||||
m_stick(0), // Initialize Joystick on port 0.
|
||||
m_motor(2), // Initialize the Talon on channel 0.
|
||||
m_encoder(1, 2) // Iniitialize encoder connected on DIO ports 1 and 2.
|
||||
{
|
||||
// Distance will give total rotations of the motor, assuming a 360 count encoder.
|
||||
m_encoder.SetDistancePerPulse(1.0 / 360.0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs the motor from the output of a Joystick.
|
||||
* Simultaneously displays encoder values on the SmartDashboard.
|
||||
*/
|
||||
void OperatorControl() {
|
||||
while (IsOperatorControl()) {
|
||||
// Set the motor controller's output.
|
||||
// This takes a number from -1 (100% speed in reverse) to +1 (100% speed forwards).
|
||||
m_motor.Set(m_stick.GetY());
|
||||
|
||||
// Display the total displacement of the encoder, in rotations.
|
||||
SmartDashboard::PutNumber("Encoder Distance", m_encoder.GetDistance());
|
||||
|
||||
Wait(kUpdatePeriod); // Wait 5ms for the next update.
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
START_ROBOT_CLASS(Robot);
|
||||
@@ -0,0 +1,69 @@
|
||||
#include "WPILib.h"
|
||||
|
||||
/**
|
||||
* This is a sample program which uses joystick buttons to control a relay.
|
||||
* A Relay (generally a spike) has two outputs, each of which can be at either
|
||||
* 0V or 12V and so can be used for actions such as turning a motor off,
|
||||
* full forwards, or full reverse, and is generally used on the compressor.
|
||||
* This program uses two buttons on a joystick and each button corresponds to
|
||||
* one output; pressing the button sets the output to 12V and releasing sets
|
||||
* it to 0V.
|
||||
* During Operator Control, the loop waits for a brief time before continuing
|
||||
* in order to allow other threads to run. This is generally a good idea,
|
||||
* especially as joystick values are only received every 20ms.
|
||||
*/
|
||||
class Robot: public SampleRobot
|
||||
{
|
||||
// Joystick with which to control the relay.
|
||||
Joystick m_stick;
|
||||
|
||||
// Relay to use for the
|
||||
Relay m_relay;
|
||||
|
||||
// Numbers of the buttons to be used for controlling the Relay.
|
||||
const int kRelayForwardButton = 1;
|
||||
const int kRelayReverseButton = 2;
|
||||
|
||||
// Update every 5milliseconds/0.005 seconds.
|
||||
const double kUpdatePeriod = 0.005;
|
||||
|
||||
public:
|
||||
Robot() :
|
||||
m_stick(0), // Use joystick on port 0.
|
||||
m_relay(0) // Relay on port 0.
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Control a Relay using Joystick buttons.
|
||||
*/
|
||||
void OperatorControl()
|
||||
{
|
||||
while (IsOperatorControl())
|
||||
{
|
||||
// Retrieve the button values. GetRawButton will return
|
||||
// true if the button is pressed and false if not.
|
||||
bool forward = m_stick.GetRawButton(kRelayForwardButton);
|
||||
bool reverse = m_stick.GetRawButton(kRelayReverseButton);
|
||||
|
||||
// Depending on the button values, we want to use one of
|
||||
// kOn, kOff, kForward, or kReverse.
|
||||
// kOn sets both outputs to 12V, kOff sets both to 0V,
|
||||
// kForward sets forward to 12V and reverse to 0V, and
|
||||
// kReverse sets reverse to 12V and forward to 0V.
|
||||
if (forward && reverse)
|
||||
m_relay.Set(Relay::kOn);
|
||||
else if (forward)
|
||||
m_relay.Set(Relay::kForward);
|
||||
else if (reverse)
|
||||
m_relay.Set(Relay::kReverse);
|
||||
else
|
||||
m_relay.Set(Relay::kOff);
|
||||
|
||||
// Insert 5ms delay in loop.
|
||||
Wait(kUpdatePeriod);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
START_ROBOT_CLASS(Robot);
|
||||
@@ -0,0 +1,77 @@
|
||||
#include "WPILib.h"
|
||||
|
||||
/**
|
||||
* This is a sample program showing the use of the solenoid classes during
|
||||
* operator control.
|
||||
* Three buttons from a joystick will be used to control two solenoids:
|
||||
* One button to control the position of a single solenoid and the other
|
||||
* two buttons to control a double solenoid.
|
||||
* Single solenoids can either be on or off, such that the air diverted through
|
||||
* them goes through either one channel or the other.
|
||||
* Double solenoids have three states: Off, Forward, and Reverse. Forward and
|
||||
* Reverse divert the air through the two channels and correspond to the
|
||||
* on and off of a single solenoid, but a double solenoid can also be "off",
|
||||
* where both channels are diverted to exhaust such that there is no pressure
|
||||
* in either channel.
|
||||
* Additionally, double solenoids take up two channels on your PCM whereas
|
||||
* single solenoids only take a single channel.
|
||||
* During Operator Control, the loop waits for a brief time before continuing
|
||||
* in order to allow other threads to run. This is generally a good idea,
|
||||
* especially as joystick values are only received every 20ms.
|
||||
*/
|
||||
class Robot: public SampleRobot
|
||||
{
|
||||
// Joystick with buttons to control solenoids with.
|
||||
Joystick m_stick;
|
||||
// Solenoids to control with the joystick.
|
||||
// Solenoid corresponds to a single solenoid.
|
||||
Solenoid m_solenoid;
|
||||
// DoubleSolenoid corresponds to a double solenoid.
|
||||
DoubleSolenoid m_doubleSolenoid;
|
||||
|
||||
// Update every 5milliseconds/0.005 seconds.
|
||||
const double kUpdatePeriod = 0.005;
|
||||
|
||||
// Numbers of the buttons to use for triggering the solenoids.
|
||||
const int kSolenoidButton = 1;
|
||||
const int kDoubleSolenoidForward = 2;
|
||||
const int kDoubleSolenoidReverse = 3;
|
||||
|
||||
public:
|
||||
Robot() :
|
||||
m_stick(0), // Use joystick on port 0.
|
||||
m_solenoid(0), // Use solenoid on channel 0.
|
||||
// Use double solenoid with Forward Channel of 1 and Reverse of 2.
|
||||
m_doubleSolenoid(1, 2)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the solenoids from the position of joystick buttons.
|
||||
*/
|
||||
void OperatorControl()
|
||||
{
|
||||
while (IsOperatorControl())
|
||||
{
|
||||
// The output of GetRawButton is true/false depending on whether
|
||||
// the button is pressed; Set takes a boolean for for whether to
|
||||
// use the default (false) channel or the other (true).
|
||||
m_solenoid.Set(m_stick.GetRawButton(kSolenoidButton));
|
||||
|
||||
// In order to set the double solenoid, we will say that if neither
|
||||
// button is pressed, it is off, if just one button is pressed,
|
||||
// set the solenoid to correspond to that button, and if both
|
||||
// are pressed, set the solenoid to Forwards.
|
||||
if (m_stick.GetRawButton(kDoubleSolenoidForward))
|
||||
m_doubleSolenoid.Set(DoubleSolenoid::kForward);
|
||||
else if (m_stick.GetRawButton(kDoubleSolenoidReverse))
|
||||
m_doubleSolenoid.Set(DoubleSolenoid::kReverse);
|
||||
else
|
||||
m_doubleSolenoid.Set(DoubleSolenoid::kOff);
|
||||
|
||||
Wait(kUpdatePeriod); // wait for a motor update time
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
START_ROBOT_CLASS(Robot);
|
||||
@@ -87,6 +87,107 @@
|
||||
<description>Example programs that demonstrate the use of the various commonly used sensors on FRC robots</description>
|
||||
</tagDescription>
|
||||
|
||||
<example>
|
||||
<name>Motor Controller</name>
|
||||
<description>Demonstrate controlling a single motor with a Joystick.</description>
|
||||
<tags>
|
||||
<tag>Robot and Motor</tag>
|
||||
<tag>Actuators</tag>
|
||||
<tag>Joystick</tag>
|
||||
<tag>Complete List</tag>
|
||||
</tags>
|
||||
<packages>
|
||||
<package>src</package>
|
||||
</packages>
|
||||
<files>
|
||||
<file source="examples/MotorControl/src/Robot.cpp" destination="src/Robot.cpp"></file>
|
||||
</files>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<name>Motor Control With Encoder</name>
|
||||
<description>Demonstrate controlling a single motor with a Joystick and displaying the net movement of the motor using an encoder.</description>
|
||||
<tags>
|
||||
<tag>Robot and Motor</tag>
|
||||
<tag>Digital</tag>
|
||||
<tag>Sensors</tag>
|
||||
<tag>Actuators</tag>
|
||||
<tag>Joystick</tag>
|
||||
<tag>Complete List</tag>
|
||||
</tags>
|
||||
<packages>
|
||||
<package>src</package>
|
||||
</packages>
|
||||
<files>
|
||||
<file source="examples/MotorControl/src/Robot.cpp" destination="src/Robot.cpp"></file>
|
||||
</files>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<name>Relay</name>
|
||||
<description>Demonstrate controlling a Relay from Joystick buttons.</description>
|
||||
<tags>
|
||||
<tag>Actuators</tag>
|
||||
<tag>Joystick</tag>
|
||||
<tag>Complete List</tag>
|
||||
</tags>
|
||||
<packages>
|
||||
<package>src</package>
|
||||
</packages>
|
||||
<files>
|
||||
<file source="examples/Relay/src/Robot.cpp" destination="src/Robot.cpp"></file>
|
||||
</files>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<name>PDP CAN Monitoring</name>
|
||||
<description>Demonstrate using CAN to monitor the voltage, current, and temperature in the Power Distribution Panel.</description>
|
||||
<tags>
|
||||
<tag>Complete List</tag>
|
||||
<tag>CAN</tag>
|
||||
<tag>Sensors</tag>
|
||||
</tags>
|
||||
<packages>
|
||||
<package>src</package>
|
||||
</packages>
|
||||
<files>
|
||||
<file source="examples/CANPDP/src/Robot.cpp" destination="src/Robot.cpp"></file>
|
||||
</files>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<name>Solenoids</name>
|
||||
<description>Demonstrate controlling a single and double solenoid from Joystick buttons.</description>
|
||||
<tags>
|
||||
<tag>Actuators</tag>
|
||||
<tag>Joystick</tag>
|
||||
<tag>Pneumatics</tag>
|
||||
<tag>Complete List</tag>
|
||||
</tags>
|
||||
<packages>
|
||||
<package>src</package>
|
||||
</packages>
|
||||
<files>
|
||||
<file source="examples/Solenoid/src/Robot.cpp" destination="src/Robot.cpp"></file>
|
||||
</files>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<name>Encoder</name>
|
||||
<description>Demonstrate displaying the value of a quadrature encoder on the SmartDashboard.</description>
|
||||
<tags>
|
||||
<tag>Complete List</tag>
|
||||
<tag>Digital</tag>
|
||||
<tag>Sensors</tag>
|
||||
</tags>
|
||||
<packages>
|
||||
<package>src</package>
|
||||
</packages>
|
||||
<files>
|
||||
<file source="examples/Encoder/src/Robot.cpp" destination="src/Robot.cpp"></file>
|
||||
</files>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<name>Arcade Drive</name>
|
||||
<description>An example program which the use of Arcade Drive with the RobotDrive class</description>
|
||||
|
||||
@@ -41,7 +41,7 @@ public class ExampleCPPWizard extends ExampleWizard {
|
||||
protected IWizardPage getDetailsPage() {
|
||||
if (detailsPage != null) return detailsPage;
|
||||
detailsPage = new NewProjectMainPage(selection, getTeamNumberPage());
|
||||
detailsPage.setTitle("Create Example Robot Java Project");
|
||||
detailsPage.setTitle("Create Example Robot C++ Project");
|
||||
detailsPage.setDescription("This wizard creates a new example project based on your selection.");
|
||||
detailsPage.setShowPackage(false);
|
||||
return detailsPage;
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
</description>
|
||||
|
||||
<copyright>
|
||||
* Copyright (c) 2013 FIRST and WPI
|
||||
* Copyright (c) 2015 FIRST and WPI
|
||||
* All rights reserved.
|
||||
</copyright>
|
||||
|
||||
<license>
|
||||
* Copyright (c) 2013 FIRST and WPI
|
||||
* Copyright (c) 2015 FIRST and WPI
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
|
||||
@@ -102,14 +102,7 @@
|
||||
<!-- Javadoc -->
|
||||
<artifactItem>
|
||||
<groupId>edu.wpi.first.wpilibj</groupId>
|
||||
<artifactId>wpilibJavaDevices</artifactId>
|
||||
<version>0.1.0-SNAPSHOT</version>
|
||||
<type>javadoc</type>
|
||||
<outputDirectory>${java-zip}/javadoc-jar</outputDirectory>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>edu.wpi.first.wpilibj</groupId>
|
||||
<artifactId>wpilibJava</artifactId>
|
||||
<artifactId>wpilibJavaFinal</artifactId>
|
||||
<version>0.1.0-SNAPSHOT</version>
|
||||
<type>javadoc</type>
|
||||
<outputDirectory>${java-zip}/javadoc-jar</outputDirectory>
|
||||
@@ -212,7 +205,7 @@
|
||||
<format property="timestamp" pattern="yyyy/MM/dd HH:mm:ss z"/>
|
||||
</tstamp>
|
||||
<tstamp>
|
||||
<format property="version-info" pattern="yyyy.MM"/>
|
||||
<format property="version-info" pattern="yyyy.MM.dd.HH.mm.ss"/>
|
||||
</tstamp>
|
||||
<property name="version" value="${version-info}.${build-number}"/>
|
||||
</target>
|
||||
|
||||
@@ -31,6 +31,10 @@ public class Robot extends IterativeRobot {
|
||||
// instantiate the command used for the autonomous period
|
||||
autonomousCommand = new ExampleCommand();
|
||||
}
|
||||
|
||||
public void disabledPeriodic() {
|
||||
Scheduler.getInstance().run();
|
||||
}
|
||||
|
||||
public void autonomousInit() {
|
||||
// schedule the autonomous command (example)
|
||||
|
||||
@@ -8,11 +8,11 @@ package $package;
|
||||
public class RobotMap {
|
||||
// For example to map the left and right motors, you could define the
|
||||
// following variables to use with your drivetrain subsystem.
|
||||
// public static final int leftMotor = 1;
|
||||
// public static final int rightMotor = 2;
|
||||
// public static int leftMotor = 1;
|
||||
// public static int rightMotor = 2;
|
||||
|
||||
// If you are using multiple modules, make sure to define both the port
|
||||
// number and the module. For example you with a rangefinder:
|
||||
// public static final int rangefinderPort = 1;
|
||||
// public static final int rangefinderModule = 1;
|
||||
// public static int rangefinderPort = 1;
|
||||
// public static int rangefinderModule = 1;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
|
||||
package org.usfirst.frc.team190.robot;
|
||||
package $package;
|
||||
|
||||
|
||||
import edu.wpi.first.wpilibj.Joystick;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
|
||||
package org.usfirst.frc.team190.robot;
|
||||
package $package;
|
||||
|
||||
|
||||
import edu.wpi.first.wpilibj.Joystick;
|
||||
|
||||
@@ -1,26 +1,47 @@
|
||||
#pragma once
|
||||
|
||||
#define SAMPLE_RATE_TOO_HIGH 1
|
||||
#define SAMPLE_RATE_TOO_HIGH_MESSAGE "Analog module sample rate is too high"
|
||||
#define VOLTAGE_OUT_OF_RANGE 2
|
||||
#define VOLTAGE_OUT_OF_RANGE_MESSAGE "Voltage to convert to raw value is out of range [0; 5]"
|
||||
#define LOOP_TIMING_ERROR 4
|
||||
#define LOOP_TIMING_ERROR_MESSAGE "Digital module loop timing is not the expected value"
|
||||
#define SPI_WRITE_NO_MOSI 12
|
||||
#define SPI_WRITE_NO_MOSI_MESSAGE "Cannot write to SPI port with no MOSI output"
|
||||
#define SPI_READ_NO_MISO 13
|
||||
#define SPI_READ_NO_MISO_MESSAGE "Cannot read from SPI port with no MISO input"
|
||||
#define SPI_READ_NO_DATA 14
|
||||
#define SPI_READ_NO_DATA_MESSAGE "No data available to read from SPI"
|
||||
#define INCOMPATIBLE_STATE 15
|
||||
#define INCOMPATIBLE_STATE_MESSAGE "Incompatible State: The operation cannot be completed"
|
||||
#define NO_AVAILABLE_RESOURCES -4
|
||||
#define NO_AVAILABLE_RESOURCES_MESSAGE "No available resources to allocate"
|
||||
#define NULL_PARAMETER -5
|
||||
#define NULL_PARAMETER_MESSAGE "A pointer parameter to a method is NULL"
|
||||
#define ANALOG_TRIGGER_LIMIT_ORDER_ERROR -10
|
||||
#define ANALOG_TRIGGER_LIMIT_ORDER_ERROR_MESSAGE "AnalogTrigger limits error. Lower limit > Upper Limit"
|
||||
#define ANALOG_TRIGGER_PULSE_OUTPUT_ERROR -11
|
||||
#define ANALOG_TRIGGER_PULSE_OUTPUT_ERROR_MESSAGE "Attempted to read AnalogTrigger pulse output."
|
||||
#define PARAMETER_OUT_OF_RANGE -28
|
||||
#define PARAMETER_OUT_OF_RANGE_MESSAGE "A parameter is out of range."
|
||||
#define CTR_RxTimeout_MESSAGE "CTRE CAN Recieve Timeout"
|
||||
#define CTR_TxTimeout_MESSAGE "CTRE CAN Transmit Timeout"
|
||||
#define CTR_InvalidParamValue_MESSAGE "CTRE CAN Invalid Parameter"
|
||||
#define CTR_UnexpectedArbId_MESSAGE "CTRE Unexpected Arbitration ID (CAN Node ID)"
|
||||
|
||||
#define NiFpga_Status_FifoTimeout_MESSAGE "NIFPGA: FIFO timeout error"
|
||||
#define NiFpga_Status_TransferAborted_MESSAGE "NIFPGA: Transfer aborted error"
|
||||
#define NiFpga_Status_MemoryFull_MESSAGE "NIFPGA: Memory Allocation failed, memory full"
|
||||
#define NiFpga_Status_SoftwareFault_MESSAGE "NIFPGA: Unexepected software error"
|
||||
#define NiFpga_Status_InvalidParameter_MESSAGE "NIFPGA: Invalid Parameter"
|
||||
#define NiFpga_Status_ResourceNotFound_MESSAGE "NIFPGA: Resource not found"
|
||||
#define NiFpga_Status_ResourceNotInitialized_MESSAGE "NIFPGA: Resource not initialized"
|
||||
#define NiFpga_Status_HardwareFault_MESSAGE "NIFPGA: Hardware Fault"
|
||||
#define NiFpga_Status_IrqTimeout_MESSAGE "NIFPGA: Interrupt timeout"
|
||||
|
||||
#define ERR_CANSessionMux_InvalidBuffer_MESSAGE "CAN: Invalid Buffer"
|
||||
#define ERR_CANSessionMux_MessageNotFound_MESSAGE "CAN: Message not found"
|
||||
#define WARN_CANSessionMux_NoToken_MESSAGE "CAN: No token"
|
||||
#define ERR_CANSessionMux_NotAllowed_MESSAGE "CAN: Not allowed"
|
||||
#define ERR_CANSessionMux_NotInitialized_MESSAGE "CAN: Not initialized"
|
||||
|
||||
#define SAMPLE_RATE_TOO_HIGH 1001
|
||||
#define SAMPLE_RATE_TOO_HIGH_MESSAGE "HAL: Analog module sample rate is too high"
|
||||
#define VOLTAGE_OUT_OF_RANGE 1002
|
||||
#define VOLTAGE_OUT_OF_RANGE_MESSAGE "HAL: Voltage to convert to raw value is out of range [0; 5]"
|
||||
#define LOOP_TIMING_ERROR 1004
|
||||
#define LOOP_TIMING_ERROR_MESSAGE "HAL: Digital module loop timing is not the expected value"
|
||||
#define SPI_WRITE_NO_MOSI 1012
|
||||
#define SPI_WRITE_NO_MOSI_MESSAGE "HAL: Cannot write to SPI port with no MOSI output"
|
||||
#define SPI_READ_NO_MISO 1013
|
||||
#define SPI_READ_NO_MISO_MESSAGE "HAL: Cannot read from SPI port with no MISO input"
|
||||
#define SPI_READ_NO_DATA 1014
|
||||
#define SPI_READ_NO_DATA_MESSAGE "HAL: No data available to read from SPI"
|
||||
#define INCOMPATIBLE_STATE 1015
|
||||
#define INCOMPATIBLE_STATE_MESSAGE "HAL: Incompatible State: The operation cannot be completed"
|
||||
#define NO_AVAILABLE_RESOURCES -1004
|
||||
#define NO_AVAILABLE_RESOURCES_MESSAGE "HAL: No available resources to allocate"
|
||||
#define NULL_PARAMETER -1005
|
||||
#define NULL_PARAMETER_MESSAGE "HAL: A pointer parameter to a method is NULL"
|
||||
#define ANALOG_TRIGGER_LIMIT_ORDER_ERROR -1010
|
||||
#define ANALOG_TRIGGER_LIMIT_ORDER_ERROR_MESSAGE "HAL: AnalogTrigger limits error. Lower limit > Upper Limit"
|
||||
#define ANALOG_TRIGGER_PULSE_OUTPUT_ERROR -1011
|
||||
#define ANALOG_TRIGGER_PULSE_OUTPUT_ERROR_MESSAGE "HAL: Attempted to read AnalogTrigger pulse output."
|
||||
#define PARAMETER_OUT_OF_RANGE -1028
|
||||
#define PARAMETER_OUT_OF_RANGE_MESSAGE "HAL: A parameter is out of range."
|
||||
|
||||
@@ -161,9 +161,20 @@ enum HALAllianceStationID {
|
||||
kHALAllianceStationID_blue3,
|
||||
};
|
||||
|
||||
/* The maximum number of axes that will be stored in a single HALJoystickAxes
|
||||
struct. This is used for allocating buffers, not bounds checking, since
|
||||
there are usually less axes in practice. */
|
||||
static constexpr size_t kMaxJoystickAxes = 12;
|
||||
static constexpr size_t kMaxJoystickPOVs = 12;
|
||||
|
||||
struct HALJoystickAxes {
|
||||
uint16_t count;
|
||||
int16_t axes[6];
|
||||
int16_t axes[kMaxJoystickAxes];
|
||||
};
|
||||
|
||||
struct HALJoystickPOVs {
|
||||
uint16_t count;
|
||||
int16_t povs[kMaxJoystickPOVs];
|
||||
};
|
||||
|
||||
typedef uint32_t HALJoystickButtons;
|
||||
@@ -199,7 +210,8 @@ extern "C"
|
||||
|
||||
int HALGetControlWord(HALControlWord *data);
|
||||
int HALGetAllianceStation(enum HALAllianceStationID *allianceStation);
|
||||
int HALGetJoystickAxes(uint8_t joystickNum, HALJoystickAxes *axes, uint8_t maxAxes);
|
||||
int HALGetJoystickAxes(uint8_t joystickNum, HALJoystickAxes *axes);
|
||||
int HALGetJoystickPOVs(uint8_t joystickNum, HALJoystickPOVs *povs);
|
||||
int HALGetJoystickButtons(uint8_t joystickNum, HALJoystickButtons *buttons, uint8_t *count);
|
||||
|
||||
void HALSetNewDataSem(pthread_mutex_t *);
|
||||
|
||||
@@ -256,7 +256,7 @@ void* allocatePWM(int32_t *status) {
|
||||
* @param pwmGenerator The pwmGen to free that was allocated with AllocateDO_PWM()
|
||||
*/
|
||||
void freePWM(void* pwmGenerator, int32_t *status) {
|
||||
uint32_t id = *((uint32_t*) pwmGenerator);
|
||||
uint32_t id = (uint32_t) pwmGenerator;
|
||||
if (id == ~0ul) return;
|
||||
DO_PWMGenerators->Free(id);
|
||||
}
|
||||
@@ -283,7 +283,7 @@ void setPWMRate(double rate, int32_t *status) {
|
||||
* @param dutyCycle The percent duty cycle to output [0..1].
|
||||
*/
|
||||
void setPWMDutyCycle(void* pwmGenerator, double dutyCycle, int32_t *status) {
|
||||
uint32_t id = *((uint32_t*) pwmGenerator);
|
||||
uint32_t id = (uint32_t) pwmGenerator;
|
||||
if (id == ~0ul) return;
|
||||
if (dutyCycle > 1.0) dutyCycle = 1.0;
|
||||
if (dutyCycle < 0.0) dutyCycle = 0.0;
|
||||
@@ -296,8 +296,10 @@ void setPWMDutyCycle(void* pwmGenerator, double dutyCycle, int32_t *status) {
|
||||
// The resolution of the duty cycle drops close to the highest frequencies.
|
||||
rawDutyCycle = rawDutyCycle / pow(2.0, 4 - pwmPeriodPower);
|
||||
}
|
||||
digitalSystem->writePWMDutyCycleA(id, (uint8_t)rawDutyCycle, status);
|
||||
digitalSystem->writePWMDutyCycleB(id, (uint8_t)rawDutyCycle, status);
|
||||
if(id < 4)
|
||||
digitalSystem->writePWMDutyCycleA(id, (uint8_t)rawDutyCycle, status);
|
||||
else
|
||||
digitalSystem->writePWMDutyCycleB(id - 3, (uint8_t)rawDutyCycle, status);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -308,28 +310,9 @@ void setPWMDutyCycle(void* pwmGenerator, double dutyCycle, int32_t *status) {
|
||||
* @param channel The Digital Output channel to output on
|
||||
*/
|
||||
void setPWMOutputChannel(void* pwmGenerator, uint32_t pin, int32_t *status) {
|
||||
uint32_t id = *((uint32_t*) pwmGenerator);
|
||||
if (id == ~0ul) return;
|
||||
switch(id) {
|
||||
case 0:
|
||||
digitalSystem->writePWMOutputSelect(0, pin, status);
|
||||
break;
|
||||
case 1:
|
||||
digitalSystem->writePWMOutputSelect(1, pin, status);
|
||||
break;
|
||||
case 2:
|
||||
digitalSystem->writePWMOutputSelect(2, pin, status);
|
||||
break;
|
||||
case 3:
|
||||
digitalSystem->writePWMOutputSelect(3, pin, status);
|
||||
break;
|
||||
case 4:
|
||||
digitalSystem->writePWMOutputSelect(4, pin, status);
|
||||
break;
|
||||
case 5:
|
||||
digitalSystem->writePWMOutputSelect(5, pin, status);
|
||||
break;
|
||||
}
|
||||
uint32_t id = (uint32_t) pwmGenerator;
|
||||
if (id > 5) return;
|
||||
digitalSystem->writePWMOutputSelect(id, pin, status);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
void enable(tRioStatusCode *status);
|
||||
void disable(tRioStatusCode *status);
|
||||
bool isEnabled(tRioStatusCode *status);
|
||||
public:
|
||||
private:
|
||||
class tInterruptThread;
|
||||
friend class tInterruptThread;
|
||||
void handler();
|
||||
@@ -58,3 +58,4 @@ public:
|
||||
|
||||
|
||||
#endif // __tInterruptManager_h__
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "Port.h"
|
||||
#include "HAL/Errors.hpp"
|
||||
#include "ctre/ctre.h"
|
||||
#include "ChipObject.h"
|
||||
#include "NetworkCommunication/FRCComm.h"
|
||||
#include "NetworkCommunication/UsageReporting.h"
|
||||
@@ -38,34 +39,72 @@ void* getPortWithModule(uint8_t module, uint8_t pin)
|
||||
|
||||
const char* getHALErrorMessage(int32_t code)
|
||||
{
|
||||
if (code == 0)
|
||||
return "";
|
||||
else if (code == SAMPLE_RATE_TOO_HIGH)
|
||||
return SAMPLE_RATE_TOO_HIGH_MESSAGE;
|
||||
else if (code == VOLTAGE_OUT_OF_RANGE)
|
||||
return VOLTAGE_OUT_OF_RANGE_MESSAGE;
|
||||
else if (code == LOOP_TIMING_ERROR)
|
||||
return LOOP_TIMING_ERROR_MESSAGE;
|
||||
else if (code == SPI_WRITE_NO_MOSI)
|
||||
return SPI_WRITE_NO_MOSI_MESSAGE;
|
||||
else if (code == SPI_READ_NO_MISO)
|
||||
return SPI_READ_NO_MISO_MESSAGE;
|
||||
else if (code == SPI_READ_NO_DATA)
|
||||
return SPI_READ_NO_DATA_MESSAGE;
|
||||
else if (code == INCOMPATIBLE_STATE)
|
||||
return INCOMPATIBLE_STATE_MESSAGE;
|
||||
else if (code == NO_AVAILABLE_RESOURCES)
|
||||
return NO_AVAILABLE_RESOURCES_MESSAGE;
|
||||
else if (code == NULL_PARAMETER)
|
||||
return NULL_PARAMETER_MESSAGE;
|
||||
else if (code == ANALOG_TRIGGER_LIMIT_ORDER_ERROR)
|
||||
return ANALOG_TRIGGER_LIMIT_ORDER_ERROR_MESSAGE;
|
||||
else if (code == ANALOG_TRIGGER_PULSE_OUTPUT_ERROR)
|
||||
return ANALOG_TRIGGER_PULSE_OUTPUT_ERROR_MESSAGE;
|
||||
else if (code == PARAMETER_OUT_OF_RANGE)
|
||||
return PARAMETER_OUT_OF_RANGE_MESSAGE;
|
||||
else
|
||||
return "";
|
||||
switch(code) {
|
||||
case 0:
|
||||
return "";
|
||||
case CTR_RxTimeout:
|
||||
return CTR_RxTimeout_MESSAGE;
|
||||
case CTR_TxTimeout:
|
||||
return CTR_TxTimeout_MESSAGE;
|
||||
case CTR_InvalidParamValue:
|
||||
return CTR_InvalidParamValue_MESSAGE;
|
||||
case CTR_UnexpectedArbId:
|
||||
return CTR_UnexpectedArbId_MESSAGE;
|
||||
case NiFpga_Status_FifoTimeout:
|
||||
return NiFpga_Status_FifoTimeout_MESSAGE;
|
||||
case NiFpga_Status_TransferAborted:
|
||||
return NiFpga_Status_TransferAborted_MESSAGE;
|
||||
case NiFpga_Status_MemoryFull:
|
||||
return NiFpga_Status_MemoryFull_MESSAGE;
|
||||
case NiFpga_Status_SoftwareFault:
|
||||
return NiFpga_Status_SoftwareFault_MESSAGE;
|
||||
case NiFpga_Status_InvalidParameter:
|
||||
return NiFpga_Status_InvalidParameter_MESSAGE;
|
||||
case NiFpga_Status_ResourceNotFound:
|
||||
return NiFpga_Status_ResourceNotFound_MESSAGE;
|
||||
case NiFpga_Status_ResourceNotInitialized:
|
||||
return NiFpga_Status_ResourceNotInitialized_MESSAGE;
|
||||
case NiFpga_Status_HardwareFault:
|
||||
return NiFpga_Status_HardwareFault_MESSAGE;
|
||||
case NiFpga_Status_IrqTimeout:
|
||||
return NiFpga_Status_IrqTimeout_MESSAGE;
|
||||
case SAMPLE_RATE_TOO_HIGH:
|
||||
return SAMPLE_RATE_TOO_HIGH_MESSAGE;
|
||||
case VOLTAGE_OUT_OF_RANGE:
|
||||
return VOLTAGE_OUT_OF_RANGE_MESSAGE;
|
||||
case LOOP_TIMING_ERROR:
|
||||
return LOOP_TIMING_ERROR_MESSAGE;
|
||||
case SPI_WRITE_NO_MOSI:
|
||||
return SPI_WRITE_NO_MOSI_MESSAGE;
|
||||
case SPI_READ_NO_MISO:
|
||||
return SPI_READ_NO_MISO_MESSAGE;
|
||||
case SPI_READ_NO_DATA:
|
||||
return SPI_READ_NO_DATA_MESSAGE;
|
||||
case INCOMPATIBLE_STATE:
|
||||
return INCOMPATIBLE_STATE_MESSAGE;
|
||||
case NO_AVAILABLE_RESOURCES:
|
||||
return NO_AVAILABLE_RESOURCES_MESSAGE;
|
||||
case NULL_PARAMETER:
|
||||
return NULL_PARAMETER_MESSAGE;
|
||||
case ANALOG_TRIGGER_LIMIT_ORDER_ERROR:
|
||||
return ANALOG_TRIGGER_LIMIT_ORDER_ERROR_MESSAGE;
|
||||
case ANALOG_TRIGGER_PULSE_OUTPUT_ERROR:
|
||||
return ANALOG_TRIGGER_PULSE_OUTPUT_ERROR_MESSAGE;
|
||||
case PARAMETER_OUT_OF_RANGE:
|
||||
return PARAMETER_OUT_OF_RANGE_MESSAGE;
|
||||
case ERR_CANSessionMux_InvalidBuffer:
|
||||
return ERR_CANSessionMux_InvalidBuffer_MESSAGE;
|
||||
case ERR_CANSessionMux_MessageNotFound:
|
||||
return ERR_CANSessionMux_MessageNotFound_MESSAGE;
|
||||
case WARN_CANSessionMux_NoToken:
|
||||
return WARN_CANSessionMux_NoToken_MESSAGE;
|
||||
case ERR_CANSessionMux_NotAllowed:
|
||||
return ERR_CANSessionMux_NotAllowed_MESSAGE;
|
||||
case ERR_CANSessionMux_NotInitialized:
|
||||
return ERR_CANSessionMux_NotInitialized_MESSAGE;
|
||||
default:
|
||||
return "Unknown error status";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -125,9 +164,14 @@ int HALGetAllianceStation(enum HALAllianceStationID *allianceStation)
|
||||
return FRC_NetworkCommunication_getAllianceStation((AllianceStationID_t*) allianceStation);
|
||||
}
|
||||
|
||||
int HALGetJoystickAxes(uint8_t joystickNum, HALJoystickAxes *axes, uint8_t maxAxes)
|
||||
int HALGetJoystickAxes(uint8_t joystickNum, HALJoystickAxes *axes)
|
||||
{
|
||||
return FRC_NetworkCommunication_getJoystickAxes(joystickNum, (JoystickAxes_t*) axes, maxAxes);
|
||||
return FRC_NetworkCommunication_getJoystickAxes(joystickNum, (JoystickAxes_t*) axes, kMaxJoystickAxes);
|
||||
}
|
||||
|
||||
int HALGetJoystickPOVs(uint8_t joystickNum, HALJoystickPOVs *povs)
|
||||
{
|
||||
return FRC_NetworkCommunication_getJoystickPOVs(joystickNum, (JoystickPOV_t*) povs, kMaxJoystickPOVs);
|
||||
}
|
||||
|
||||
int HALGetJoystickButtons(uint8_t joystickNum, HALJoystickButtons *buttons, uint8_t *count)
|
||||
|
||||
@@ -9,7 +9,12 @@ void delayTicks(int32_t ticks)
|
||||
struct timespec test, remaining;
|
||||
test.tv_sec = 0;
|
||||
test.tv_nsec = ticks * 3;
|
||||
nanosleep(&test, &remaining);
|
||||
|
||||
/* Sleep until the requested number of ticks has passed, with additional
|
||||
time added if nanosleep is interrupted. */
|
||||
while(nanosleep(&test, &remaining) == -1) {
|
||||
test = remaining;
|
||||
}
|
||||
}
|
||||
|
||||
void delayMillis(double ms)
|
||||
@@ -17,7 +22,12 @@ void delayMillis(double ms)
|
||||
struct timespec test, remaining;
|
||||
test.tv_sec = ms / 1000;
|
||||
test.tv_nsec = 1000 * (((uint64_t)ms) % 1000000);
|
||||
nanosleep(&test, &remaining);
|
||||
|
||||
/* Sleep until the requested number of milliseconds has passed, with
|
||||
additional time added if nanosleep is interrupted. */
|
||||
while(nanosleep(&test, &remaining) == -1) {
|
||||
test = remaining;
|
||||
}
|
||||
}
|
||||
|
||||
void delaySeconds(double s)
|
||||
@@ -25,5 +35,10 @@ void delaySeconds(double s)
|
||||
struct timespec test, remaining;
|
||||
test.tv_sec = (int)s;
|
||||
test.tv_nsec = (s - (int)s) * 1000000000.0;
|
||||
nanosleep(&test, &remaining);
|
||||
|
||||
/* Sleep until the requested number of seconds has passed, with additional
|
||||
time added if nanosleep is interrupted. */
|
||||
while(nanosleep(&test, &remaining) == -1) {
|
||||
test = remaining;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>edu.wpi.first.wpilib.networktables.java</groupId>
|
||||
<artifactId>NetworkTables</artifactId>
|
||||
@@ -38,11 +38,19 @@
|
||||
<profile>
|
||||
<id>docline-java8-disable</id>
|
||||
<activation>
|
||||
<jdk>[1.8,</jdk>
|
||||
<jdk>[1.8,</jdk>
|
||||
</activation>
|
||||
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>filesystem.repo</id>
|
||||
<name>Temporary Staging Repository</name>
|
||||
<url>file://${user.home}/releases/maven</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
@@ -50,7 +58,7 @@
|
||||
<additionalparam>-Xdoclint:none</additionalparam>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
@@ -63,9 +71,9 @@
|
||||
<configuration>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
<testExcludes>
|
||||
<exclude>edu/wpi/first/wpilibj/networktables2/system/SystemTest.java</exclude>
|
||||
</testExcludes>
|
||||
<testExcludes>
|
||||
<exclude>edu/wpi/first/wpilibj/networktables2/system/SystemTest.java</exclude>
|
||||
</testExcludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
@@ -92,8 +100,8 @@
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
@@ -1,25 +1,90 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>edu.wpi.first.wpilib.networktables</groupId>
|
||||
<artifactId>java</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>0.1.0-SNAPSHOT</version>
|
||||
|
||||
<modules>
|
||||
<module>Athena</module>
|
||||
</modules>
|
||||
<groupId>edu.wpi.first.wpilib.networktables.java</groupId>
|
||||
<artifactId>NetworkTables</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>edu.wpi.first.wpilib.templates.athena</groupId>
|
||||
<artifactId>library-jar</artifactId>
|
||||
<version>0.1.0-SNAPSHOT</version>
|
||||
<relativePath>../../maven-utilities/athena/library-jar</relativePath>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.11</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jmock</groupId>
|
||||
<artifactId>jmock-junit4</artifactId>
|
||||
<version>2.6.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jmock</groupId>
|
||||
<artifactId>jmock-legacy</artifactId>
|
||||
<version>2.6.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>filesystem.repo</id>
|
||||
<name>Temporary Staging Repository</name>
|
||||
<url>file://${user.home}/releases/maven</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>desktop</id>
|
||||
<id>docline-java8-disable</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
<jdk>[1.8,</jdk>
|
||||
</activation>
|
||||
<modules>
|
||||
<module>Athena</module>
|
||||
</modules>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<configuration>
|
||||
<additionalparam>-Xdoclint:none</additionalparam>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.1</version>
|
||||
<configuration>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
<testExcludes>
|
||||
<exclude>edu/wpi/first/wpilibj/networktables2/system/SystemTest.java</exclude>
|
||||
</testExcludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
@@ -19,9 +19,9 @@ public class SocketTest {
|
||||
}};
|
||||
|
||||
|
||||
@Test(timeout=1000)
|
||||
@Test(timeout=1500)
|
||||
public void testSingleSocketConnection() throws Throwable {
|
||||
doSocketTest(1, 500, 1000, SocketStreams.newStreamProvider(10111), SocketStreams.newStreamFactory("localhost", 10111));
|
||||
doSocketTest(1, 500, 1500, SocketStreams.newStreamProvider(10111), SocketStreams.newStreamFactory("localhost", 10111));
|
||||
}
|
||||
@Test(timeout=2500)
|
||||
public void testManySocketConnection() throws Throwable {
|
||||
@@ -10,7 +10,7 @@ import org.junit.*;
|
||||
|
||||
public class DefaultThreadManagerTest {
|
||||
volatile Throwable exception = null;
|
||||
@Test(timeout=300)
|
||||
@Test(timeout=400)
|
||||
public void testConcurrentThreads() throws Throwable {
|
||||
final int numCounts = 10;
|
||||
final int numThreads = 10;
|
||||
Binary file not shown.
Binary file not shown.
2
ni-libraries/libni_emb.so
Normal file
2
ni-libraries/libni_emb.so
Normal file
@@ -0,0 +1,2 @@
|
||||
OUTPUT_FORMAT(elf32-littlearm)
|
||||
GROUP ( libni_emb.so.7 )
|
||||
2
ni-libraries/libni_emb.so.7
Normal file
2
ni-libraries/libni_emb.so.7
Normal file
@@ -0,0 +1,2 @@
|
||||
OUTPUT_FORMAT(elf32-littlearm)
|
||||
GROUP ( libni_emb.so.7.0 )
|
||||
2
ni-libraries/libni_emb.so.7.0
Normal file
2
ni-libraries/libni_emb.so.7.0
Normal file
@@ -0,0 +1,2 @@
|
||||
OUTPUT_FORMAT(elf32-littlearm)
|
||||
GROUP ( libni_emb.so.7.0.0 )
|
||||
BIN
ni-libraries/libni_emb.so.7.0.0
Normal file
BIN
ni-libraries/libni_emb.so.7.0.0
Normal file
Binary file not shown.
2
ni-libraries/libni_rtlog.so
Normal file
2
ni-libraries/libni_rtlog.so
Normal file
@@ -0,0 +1,2 @@
|
||||
OUTPUT_FORMAT(elf32-littlearm)
|
||||
GROUP ( libni_rtlog.so.2 )
|
||||
2
ni-libraries/libni_rtlog.so.2
Normal file
2
ni-libraries/libni_rtlog.so.2
Normal file
@@ -0,0 +1,2 @@
|
||||
OUTPUT_FORMAT(elf32-littlearm)
|
||||
GROUP ( libni_rtlog.so.2.3 )
|
||||
2
ni-libraries/libni_rtlog.so.2.3
Normal file
2
ni-libraries/libni_rtlog.so.2.3
Normal file
@@ -0,0 +1,2 @@
|
||||
OUTPUT_FORMAT(elf32-littlearm)
|
||||
GROUP ( libni_rtlog.so.2.3.0 )
|
||||
BIN
ni-libraries/libni_rtlog.so.2.3.0
Normal file
BIN
ni-libraries/libni_rtlog.so.2.3.0
Normal file
Binary file not shown.
2
ni-libraries/libnirio_emb_can.so
Normal file
2
ni-libraries/libnirio_emb_can.so
Normal file
@@ -0,0 +1,2 @@
|
||||
OUTPUT_FORMAT(elf32-littlearm)
|
||||
GROUP ( libnirio_emb_can.so.14 )
|
||||
2
ni-libraries/libnirio_emb_can.so.14
Normal file
2
ni-libraries/libnirio_emb_can.so.14
Normal file
@@ -0,0 +1,2 @@
|
||||
OUTPUT_FORMAT(elf32-littlearm)
|
||||
GROUP ( libnirio_emb_can.so.14.0 )
|
||||
2
ni-libraries/libnirio_emb_can.so.14.0
Normal file
2
ni-libraries/libnirio_emb_can.so.14.0
Normal file
@@ -0,0 +1,2 @@
|
||||
OUTPUT_FORMAT(elf32-littlearm)
|
||||
GROUP ( libnirio_emb_can.so.14.0.0 )
|
||||
BIN
ni-libraries/libnirio_emb_can.so.14.0.0
Normal file
BIN
ni-libraries/libnirio_emb_can.so.14.0.0
Normal file
Binary file not shown.
BIN
ni-libraries/libvisa.so
Normal file
BIN
ni-libraries/libvisa.so
Normal file
Binary file not shown.
@@ -17,11 +17,12 @@ DEFAULT_DESTINATION_CPP_TEST_FILE=${DEFAULT_TEST_SCP_DIR}/${DEFAULT_CPP_TEST_NAM
|
||||
|
||||
DEFAULT_DESTINATION_RUN_TEST_SCRIPT=${DEFAULT_DESTINATION_DIR}/${DEFAULT_LOCAL_RUN_TEST_SCRIPT}
|
||||
|
||||
usage="$(basename "$0") [-h] (java|cpp) [-A] [arg] [arg]...
|
||||
usage="$(basename "$0") [-h] (java|cpp) [-m] [-A] [arg] [arg]...
|
||||
A script designed to run the integration tests.
|
||||
This script should only be run on the roborio.
|
||||
Where:
|
||||
-h Show this help text.
|
||||
-m The driver station mutex will be handled manually.
|
||||
-A Disable language recomended arguments.
|
||||
arg Additional arguments to be passed to test."
|
||||
|
||||
@@ -60,14 +61,20 @@ if [[ ! -e ${LOCAL_TEST_FILE} ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TEST_RUN_ARGS="${@:2}"
|
||||
MUTEX_OVERRIDE_PARAM_TEXT=""
|
||||
if [[ "$2" = "-m" ]]; then
|
||||
MUTEX_OVERRIDE_PARAM_TEXT="-m "
|
||||
TEST_RUN_ARGS="${@:3}"
|
||||
else
|
||||
TEST_RUN_ARGS="${@:2}"
|
||||
fi
|
||||
|
||||
shopt -s huponexit
|
||||
|
||||
SCP_TEST_SCRIPT="scp config.sh ${DEFAULT_LOCAL_RUN_TEST_SCRIPT} ${ROBOT_ADDRESS}:/${DEFAULT_DESTINATION_DIR}"
|
||||
SSH_CHMOD_AND_MAKE_TEMP_TEST_DIR="ssh -t ${ROBOT_ADDRESS} chmod a+x ${DEFAULT_DESTINATION_RUN_TEST_SCRIPT}; mkdir ${DEFAULT_TEST_SCP_DIR} 2>/dev/null"
|
||||
SCP_TEST_PROGRAM="scp ${LOCAL_TEST_FILE} ${ROBOT_ADDRESS}:/${DESTINATION_TEST_FILE}"
|
||||
SSH_RUN_TESTS="ssh -t ${ROBOT_ADDRESS} ${DEFAULT_DESTINATION_RUN_TEST_SCRIPT} ${LANGUAGE} $(whoami) -d ${DEFAULT_TEST_SCP_DIR} ${TEST_RUN_ARGS}"
|
||||
SSH_RUN_TESTS="ssh -t ${ROBOT_ADDRESS} ${DEFAULT_DESTINATION_RUN_TEST_SCRIPT} ${LANGUAGE} $(whoami) ${MUTEX_OVERRIDE_PARAM_TEXT}-d ${DEFAULT_TEST_SCP_DIR} ${TEST_RUN_ARGS}"
|
||||
|
||||
if [ $(which sshpass) ]; then
|
||||
sshpass -p "" ${SCP_TEST_SCRIPT}
|
||||
|
||||
@@ -9,6 +9,34 @@
|
||||
# Configurable variables
|
||||
source config.sh
|
||||
|
||||
# Setup the mutex release before we grab it
|
||||
mutexTaken=false
|
||||
# This function should run even if the script exits abnormally
|
||||
function finish {
|
||||
if [ "$mutexTaken" == true ]; then
|
||||
SSH_GIVE_MUTEX="ssh -t ${ROBOT_ADDRESS} /usr/local/frc/bin/teststand give --name=$(whoami)"
|
||||
if [ $(which sshpass) ]; then
|
||||
sshpass -p "" ${SSH_GIVE_MUTEX}
|
||||
else
|
||||
printf "WARNING!!! THIS IS HOW THE MUTEX IS RELEASED!\nIF YOU CHOOSE TO 'ctr+c' NOW YOU WILL HAVE TO HAND BACK THE MUTEX MANUALLY ON THE ROBOT.\n"
|
||||
eval ${SSH_GIVE_MUTEX}
|
||||
fi
|
||||
mutexTaken=false
|
||||
fi
|
||||
}
|
||||
trap finish EXIT SIGINT
|
||||
|
||||
|
||||
|
||||
# Take the mutex from the driver station
|
||||
mutexTaken=true
|
||||
SSH_TAKE_MUTEX="ssh -t ${ROBOT_ADDRESS} /usr/local/frc/bin/teststand take --name=$(whoami)"
|
||||
if [ $(which sshpass) ]; then
|
||||
sshpass -p "" ${SSH_TAKE_MUTEX}
|
||||
else
|
||||
eval ${SSH_TAKE_MUTEX}
|
||||
fi
|
||||
|
||||
# If there are already test results in the repository then remove them
|
||||
if [[ -e ${DEFAULT_LOCAL_TEST_RESULTS_DIR} ]]; then
|
||||
rm -R ${DEFAULT_LOCAL_TEST_RESULTS_DIR}
|
||||
@@ -28,7 +56,7 @@ fi
|
||||
printf "Running cpp test\n"
|
||||
|
||||
# Run the C++ Tests
|
||||
./deploy-and-run-test-on-robot.sh cpp -A "--gtest_output=xml:${DEFAULT_DESTINATION_CPP_TEST_RESULTS}"
|
||||
./deploy-and-run-test-on-robot.sh cpp -m -A "--gtest_output=xml:${DEFAULT_DESTINATION_CPP_TEST_RESULTS}"
|
||||
|
||||
# Retrive the C++ Test Results
|
||||
SCP_GET_CPP_TEST_RESULT="scp ${ROBOT_ADDRESS}:${DEFAULT_DESTINATION_CPP_TEST_RESULTS} ${DEFAULT_LOCAL_CPP_TEST_RESULT}"
|
||||
@@ -39,7 +67,7 @@ else
|
||||
fi
|
||||
|
||||
# Run the Java Tests
|
||||
./deploy-and-run-test-on-robot.sh java
|
||||
./deploy-and-run-test-on-robot.sh java -m
|
||||
|
||||
# Retrive the Java Test Results
|
||||
SCP_GET_JAVA_TEST_RESULT="scp ${ROBOT_ADDRESS}:${DEFAULT_DESTINATION_JAVA_TEST_RESULTS} ${DEFAULT_LOCAL_JAVA_TEST_RESULT}"
|
||||
@@ -48,3 +76,5 @@ if [ $(which sshpass) ]; then
|
||||
else
|
||||
eval ${SCP_GET_JAVA_TEST_RESULT}
|
||||
fi
|
||||
|
||||
# The mutex is released when this program exits
|
||||
@@ -17,7 +17,7 @@ source config.sh
|
||||
DEFAULT_TEST_DIR=${DEFAULT_DESTINATION_DIR}
|
||||
DEFAULT_PATH_TO_JRE=/usr/local/frc/JRE/bin/java
|
||||
|
||||
usage="$(basename "$0") [-h] (java|cpp) name [-d test_dir] [-A] [arg] [arg]...
|
||||
usage="$(basename "$0") [-h] (java|cpp) name [-d test_dir] [-m] [-A] [arg] [arg]...
|
||||
A script designed to run the integration tests.
|
||||
This script should only be run on the roborio.
|
||||
Where:
|
||||
@@ -29,14 +29,19 @@ Where:
|
||||
This scrip will automatically move the test into the ${DEFAULT_TEST_DIR}
|
||||
directory when the driver station mutex is released.
|
||||
Default: Assumes the test is in the same directory as this scrip.
|
||||
-m The driver station mutex will be handled manually.
|
||||
-A Do not use the default arguments for the given language.
|
||||
arg The arguments to be passed to test."
|
||||
|
||||
mutexTaken=false
|
||||
driverStationEnabled=false
|
||||
# This function should run even if the script exits abnormally
|
||||
function finish {
|
||||
if [ "$mutexTaken" == true ]; then
|
||||
if [ "$driverStationEnabled" == true ]; then
|
||||
/usr/local/frc/bin/teststand ds --name="${NAME}" disable
|
||||
driverStationEnabled=false
|
||||
fi
|
||||
if [ "$mutexTaken" == true ]; then
|
||||
/usr/local/frc/bin/teststand give --name="${NAME}"
|
||||
mutexTaken=false
|
||||
fi
|
||||
@@ -46,6 +51,8 @@ trap finish EXIT SIGINT
|
||||
# This function should be run asynchronysly to enable the tests 10
|
||||
# seconds after they have been run.
|
||||
function enableIn10Seconds {
|
||||
/usr/local/frc/bin/teststand ds --name="${NAME}" disable
|
||||
driverStationEnabled=true
|
||||
sleep 10
|
||||
/usr/local/frc/bin/teststand ds --name="${NAME}" enable
|
||||
}
|
||||
@@ -68,6 +75,7 @@ PARAM_ARGS=${@:3}
|
||||
TEST_RUN_ARGS=${@:3}
|
||||
RUN_WITH_DEFAULT_ARGS=true
|
||||
DEFAULT_ARGS=""
|
||||
MUTEX_OVERRIDE=false
|
||||
|
||||
# Determine the language that we are attempting to run
|
||||
if [[ "$1" = java ]]; then
|
||||
@@ -92,7 +100,7 @@ PARAM_COUNTER=2
|
||||
printf "Param Args ${PARAM_ARGS}\n"
|
||||
|
||||
# Check for optional paramaters
|
||||
while getopts ':hd:A' option $PARAM_ARGS ; do
|
||||
while getopts ':hmd:A' option $PARAM_ARGS ; do
|
||||
case "$option" in
|
||||
h)
|
||||
# Print the help message
|
||||
@@ -105,6 +113,10 @@ while getopts ':hd:A' option $PARAM_ARGS ; do
|
||||
RUN_WITH_DEFAULT_ARGS=false
|
||||
PARAM_COUNTER=$[$PARAM_COUNTER +1]
|
||||
;;
|
||||
m)
|
||||
MUTEX_OVERRIDE=true
|
||||
PARAM_COUNTER=$[$PARAM_COUNTER +1]
|
||||
;;
|
||||
d)
|
||||
TEST_DIR=$OPTARG
|
||||
# Since we are selecting the directory the run args start from the 5th argument
|
||||
@@ -130,9 +142,14 @@ if [[ $# -lt $PARAM_COUNTER ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Attempt to take the mutex for the driver station
|
||||
mutexTaken=true
|
||||
/usr/local/frc/bin/teststand take --name="${NAME}"
|
||||
# If the mutex has been retrived a higher level in the tree
|
||||
if [ "$MUTEX_OVERRIDE" == false ]; then
|
||||
# Attempt to take the mutex for the driver station
|
||||
mutexTaken=true
|
||||
/usr/local/frc/bin/teststand take --name="${NAME}"
|
||||
else
|
||||
printf "Override driver station control enabled.\n"
|
||||
fi
|
||||
|
||||
# Kill all running robot programs
|
||||
killall java FRCUserProgram
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
source config.sh
|
||||
|
||||
TESTSTAND_SERVE_COMMAND=".scratch/teststand serve"
|
||||
TESTSTAND_SERVE_COMMAND="/usr/local/frc/bin/teststand serve"
|
||||
|
||||
#Checks to see if the mutex driver station is running. If it isn't then start it.
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
const char *GetFunction() const;
|
||||
uint32_t GetLineNumber() const;
|
||||
const ErrorBase* GetOriginatingObject() const;
|
||||
double GetTime() const;
|
||||
double GetTimestamp() const;
|
||||
void Clear();
|
||||
void Set(Code code, const char* contextMessage, const char* filename, const char *function,
|
||||
uint32_t lineNumber, const ErrorBase* originatingObject);
|
||||
|
||||
@@ -33,4 +33,6 @@ public:
|
||||
virtual bool GetTop(JoystickHand hand = kRightHand) = 0;
|
||||
virtual bool GetBumper(JoystickHand hand = kRightHand) = 0;
|
||||
virtual bool GetRawButton(uint32_t button) = 0;
|
||||
|
||||
virtual int GetPOV(uint32_t pov = 0) = 0;
|
||||
};
|
||||
|
||||
@@ -26,13 +26,16 @@ public:
|
||||
|
||||
static void PutBoolean(std::string keyName, bool value);
|
||||
static bool GetBoolean(std::string keyName);
|
||||
static bool GetBoolean(std::string keyName, bool defaultValue);
|
||||
|
||||
static void PutNumber(std::string keyName, double value);
|
||||
static double GetNumber(std::string keyName);
|
||||
static double GetNumber(std::string keyName, double defaultValue);
|
||||
|
||||
static void PutString(std::string keyName, std::string value);
|
||||
static int GetString(std::string keyName, char *value, unsigned int valueLen);
|
||||
static std::string GetString(std::string keyName);
|
||||
static std::string GetString(std::string keyName, std::string defaultValue);
|
||||
|
||||
static void PutValue(std::string keyName, ComplexData& value);
|
||||
static void RetrieveValue(std::string keyName, ComplexData& value);
|
||||
|
||||
@@ -35,6 +35,9 @@ public:
|
||||
static double GetFPGATimestamp();
|
||||
static double GetPPCTimestamp();
|
||||
static double GetMatchTime();
|
||||
|
||||
// The time, in seconds, at which the 32-bit FPGA timestamp rolls over to 0
|
||||
static constexpr double kRolloverTime = (1ll << 32) / 1e6;
|
||||
|
||||
private:
|
||||
double m_startTime;
|
||||
|
||||
@@ -65,8 +65,8 @@ S(CompressorTaskError, 3, "Compressor task won't start");
|
||||
S(LoopTimingError, 4, "Digital module loop timing is not the expected value");
|
||||
S(NonBinaryDigitalValue, 5, "Digital output value is not 0 or 1");
|
||||
S(IncorrectBatteryChannel, 6, "Battery measurement channel is not correct value");
|
||||
S(BadJoystickIndex, 7, "Joystick index is out of range, should be 1-4");
|
||||
S(BadJoystickAxis, 8, "Joystick axis is out of range");
|
||||
S(BadJoystickIndex, 7, "Joystick index is out of range, should be 0-3");
|
||||
S(BadJoystickAxis, 8, "Joystick axis or POV is out of range");
|
||||
S(InvalidMotorIndex, 9, "Motor index is out of range, should be 0-3");
|
||||
S(DriverStationTaskError, 10, "Driver Station task won't start");
|
||||
S(EnhancedIOPWMPeriodOutOfRange, 11, "Driver Station Enhanced IO PWM Output period out of range.");
|
||||
|
||||
@@ -8,13 +8,12 @@
|
||||
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <cstdlib>
|
||||
#include <stdint.h>
|
||||
#include "HAL/Task.hpp"
|
||||
|
||||
//#include "NetworkCommunication/FRCComm.h"
|
||||
#include "DriverStation.h"
|
||||
#include "Timer.h"
|
||||
#include "Utility.h"
|
||||
bool Error::m_suspendOnErrorEnabled = false;
|
||||
@@ -58,20 +57,30 @@ uint32_t Error::GetLineNumber() const
|
||||
const ErrorBase* Error::GetOriginatingObject() const
|
||||
{ return m_originatingObject; }
|
||||
|
||||
double Error::GetTime() const
|
||||
double Error::GetTimestamp() const
|
||||
{ return m_timestamp; }
|
||||
|
||||
void Error::Set(Code code, const char* contextMessage, const char* filename, const char* function, uint32_t lineNumber, const ErrorBase* originatingObject)
|
||||
{
|
||||
bool report = true;
|
||||
|
||||
if(code == m_code && GetTime() - m_timestamp < 1)
|
||||
{
|
||||
report = false;
|
||||
}
|
||||
|
||||
m_code = code;
|
||||
m_message = contextMessage;
|
||||
m_filename = filename;
|
||||
m_function = function;
|
||||
m_lineNumber = lineNumber;
|
||||
m_originatingObject = originatingObject;
|
||||
m_timestamp = GetTime();
|
||||
|
||||
Report();
|
||||
if(report)
|
||||
{
|
||||
m_timestamp = GetTime();
|
||||
Report();
|
||||
}
|
||||
|
||||
if (m_suspendOnErrorEnabled) suspendTask(0);
|
||||
}
|
||||
@@ -87,9 +96,7 @@ void Error::Report()
|
||||
|
||||
std::string error = errorStream.str();
|
||||
|
||||
// Print the error and send it to the DriverStation
|
||||
std::cout << error << std::endl;
|
||||
// TODO: Better logging HALSetErrorData(error.c_str(), error.size(), 100);
|
||||
DriverStation::ReportError(error);
|
||||
}
|
||||
|
||||
void Error::Clear()
|
||||
|
||||
@@ -110,7 +110,7 @@ void SmartDashboard::PutBoolean(std::string keyName, bool value)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value at the specified key.
|
||||
* Returns the value at the specified key. Throws an exception if the key is not found in the table
|
||||
* @param keyName the key
|
||||
* @return the value
|
||||
*/
|
||||
@@ -119,6 +119,16 @@ bool SmartDashboard::GetBoolean(std::string keyName)
|
||||
return m_table->GetBoolean(keyName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value at the specified key. If the key is not found, returns the default value.
|
||||
* @param keyName the key
|
||||
* @return the value
|
||||
*/
|
||||
bool SmartDashboard::GetBoolean(std::string keyName, bool defaultValue)
|
||||
{
|
||||
return m_table->GetBoolean(keyName, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Maps the specified key to the specified value in this table.
|
||||
* The key can not be NULL.
|
||||
@@ -131,7 +141,7 @@ void SmartDashboard::PutNumber(std::string keyName, double value){
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value at the specified key.
|
||||
* Returns the value at the specified key. Throws an exception if the key is not found in the table.
|
||||
* @param keyName the key
|
||||
* @return the value
|
||||
*/
|
||||
@@ -140,6 +150,16 @@ double SmartDashboard::GetNumber(std::string keyName)
|
||||
return m_table->GetNumber(keyName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value at the specified key. If the key is not found, returns the default value.
|
||||
* @param keyName the key
|
||||
* @return the value
|
||||
*/
|
||||
double SmartDashboard::GetNumber(std::string keyName, double defaultValue)
|
||||
{
|
||||
return m_table->GetNumber(keyName, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Maps the specified key to the specified value in this table.
|
||||
* Neither the key nor the value can be NULL.
|
||||
@@ -170,7 +190,7 @@ int SmartDashboard::GetString(std::string keyName, char *outBuffer, unsigned int
|
||||
|
||||
|
||||
/**
|
||||
* Returns the value at the specified key.
|
||||
* Returns the value at the specified key. Throws an exception if the key is not found in the table
|
||||
* @param keyName the key
|
||||
* @return the value
|
||||
*/
|
||||
@@ -178,3 +198,13 @@ std::string SmartDashboard::GetString(std::string keyName)
|
||||
{
|
||||
return m_table->GetString(keyName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value at the specified key. If the key is not found, returns the default value.
|
||||
* @param keyName the key
|
||||
* @return the value
|
||||
*/
|
||||
std::string SmartDashboard::GetString(std::string keyName, std::string defaultValue)
|
||||
{
|
||||
return m_table->GetString(keyName, defaultValue);
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ public:
|
||||
/** Sets a potentiometer as the position reference only. <br> Passed as the "tag" when setting the control mode. */
|
||||
static const struct PotentiometerStruct {} Potentiometer;
|
||||
|
||||
typedef enum {kPercentVbus, kCurrent, kSpeed, kPosition, kVoltage} ControlMode;
|
||||
typedef enum {kCurrentFault = 1, kTemperatureFault = 2, kBusVoltageFault = 4, kGateDriverFault = 8} Faults;
|
||||
typedef enum {kForwardLimit = 1, kReverseLimit = 2} Limits;
|
||||
typedef enum {
|
||||
@@ -133,6 +134,7 @@ public:
|
||||
void ConfigReverseLimit(double reverseLimitPosition);
|
||||
void ConfigMaxOutputVoltage(double voltage);
|
||||
void ConfigFaultTime(float faultTime);
|
||||
ControlMode GetControlMode();
|
||||
|
||||
static void UpdateSyncGroup(uint8_t syncGroup);
|
||||
|
||||
@@ -143,13 +145,12 @@ public:
|
||||
bool IsSafetyEnabled();
|
||||
void SetSafetyEnabled(bool enabled);
|
||||
void GetDescription(char *desc);
|
||||
uint8_t GetDeviceID();
|
||||
|
||||
protected:
|
||||
// Control mode helpers
|
||||
typedef enum {kPercentVbus, kCurrent, kSpeed, kPosition, kVoltage} ControlMode;
|
||||
|
||||
void ChangeControlMode(ControlMode controlMode);
|
||||
ControlMode GetControlMode();
|
||||
|
||||
void SetSpeedReference(uint8_t reference);
|
||||
uint8_t GetSpeedReference();
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user