mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-03 03:01:44 +00:00
Compare commits
9 Commits
jenkins-re
...
jenkins-st
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f24c8b1b8d | ||
|
|
d62256156e | ||
|
|
61dbd43664 | ||
|
|
f913b5de8c | ||
|
|
bd3e068f3b | ||
|
|
c6ff69079a | ||
|
|
5d3ac3ea71 | ||
|
|
f9e87f0cce | ||
|
|
75a91e24ef |
@@ -18,7 +18,6 @@ allprojects {
|
||||
maven {
|
||||
url publishUrl
|
||||
}
|
||||
mavenLocal()
|
||||
maven {
|
||||
url repoBaseUrl
|
||||
}
|
||||
|
||||
@@ -11,10 +11,10 @@
|
||||
#define CONTROL_1 0x08041C00 /* PDP_Control_ClearStats */
|
||||
|
||||
#define EXPECTED_RESPONSE_TIMEOUT_MS (50)
|
||||
#define GET_STATUS1() CtreCanNode::recMsg<PdpStatus1_t> rx = GetRx<PdpStatus1_t>(STATUS_1,EXPECTED_RESPONSE_TIMEOUT_MS)
|
||||
#define GET_STATUS2() CtreCanNode::recMsg<PdpStatus2_t> rx = GetRx<PdpStatus2_t>(STATUS_2,EXPECTED_RESPONSE_TIMEOUT_MS)
|
||||
#define GET_STATUS3() CtreCanNode::recMsg<PdpStatus3_t> rx = GetRx<PdpStatus3_t>(STATUS_3,EXPECTED_RESPONSE_TIMEOUT_MS)
|
||||
#define GET_STATUS_ENERGY() CtreCanNode::recMsg<PDP_Status_Energy_t> rx = GetRx<PDP_Status_Energy_t>(STATUS_ENERGY,EXPECTED_RESPONSE_TIMEOUT_MS)
|
||||
#define GET_STATUS1() CtreCanNode::recMsg<PdpStatus1_t> rx = GetRx<PdpStatus1_t>(STATUS_1|GetDeviceNumber(),EXPECTED_RESPONSE_TIMEOUT_MS)
|
||||
#define GET_STATUS2() CtreCanNode::recMsg<PdpStatus2_t> rx = GetRx<PdpStatus2_t>(STATUS_2|GetDeviceNumber(),EXPECTED_RESPONSE_TIMEOUT_MS)
|
||||
#define GET_STATUS3() CtreCanNode::recMsg<PdpStatus3_t> rx = GetRx<PdpStatus3_t>(STATUS_3|GetDeviceNumber(),EXPECTED_RESPONSE_TIMEOUT_MS)
|
||||
#define GET_STATUS_ENERGY() CtreCanNode::recMsg<PDP_Status_Energy_t> rx = GetRx<PDP_Status_Energy_t>(STATUS_ENERGY|GetDeviceNumber(),EXPECTED_RESPONSE_TIMEOUT_MS)
|
||||
|
||||
/* encoder/decoders */
|
||||
typedef struct _PdpStatus1_t{
|
||||
|
||||
@@ -34,17 +34,32 @@ int HALGetJoystickButtons(uint8_t joystickNum, HALJoystickButtons *buttons)
|
||||
{
|
||||
return FRC_NetworkCommunication_getJoystickButtons(joystickNum, &buttons->buttons, &buttons->count);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the Joystick Descriptor for particular slot
|
||||
* @param desc [out] descriptor (data transfer object) to fill in. desc is filled in regardless of success.
|
||||
* In other words, if descriptor is not available, desc is filled in with default
|
||||
* values matching the init-values in Java and C++ Driverstation for when caller
|
||||
* requests a too-large joystick index.
|
||||
*
|
||||
* @return error code reported from Network Comm back-end. Zero is good, nonzero is bad.
|
||||
*/
|
||||
int HALGetJoystickDescriptor(uint8_t joystickNum, HALJoystickDescriptor *desc)
|
||||
{
|
||||
desc->isXbox = 0;
|
||||
desc->type = -1;
|
||||
desc->name[0] = '\0';
|
||||
desc->axisCount = 0;
|
||||
desc->axisCount = kMaxJoystickAxes; /* set to the desc->axisTypes's capacity */
|
||||
desc->buttonCount = 0;
|
||||
desc->povCount = 0;
|
||||
return FRC_NetworkCommunication_getJoystickDesc(joystickNum, &desc->isXbox, &desc->type, (char *)(&desc->name),
|
||||
int retval = FRC_NetworkCommunication_getJoystickDesc(joystickNum, &desc->isXbox, &desc->type, (char *)(&desc->name),
|
||||
&desc->axisCount, (uint8_t *)&desc->axisTypes, &desc->buttonCount, &desc->povCount);
|
||||
/* check the return, if there is an error and the RIOimage predates FRC2017, then axisCount needs to be cleared */
|
||||
if(retval != 0)
|
||||
{
|
||||
/* set count to zero so downstream code doesn't decode invalid axisTypes. */
|
||||
desc->axisCount = 0;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
int HALGetJoystickIsXbox(uint8_t joystickNum)
|
||||
|
||||
@@ -27,6 +27,7 @@ void RobotBase::setInstance(RobotBase *robot) {
|
||||
RobotBase &RobotBase::getInstance() { return *m_instance; }
|
||||
|
||||
void RobotBase::robotSetup(RobotBase *robot) {
|
||||
printf("\n********** Robot program starting **********\n");
|
||||
robot->StartCompetition();
|
||||
}
|
||||
|
||||
@@ -55,7 +56,7 @@ RobotBase::RobotBase() : m_ds(DriverStation::GetInstance()) {
|
||||
file = fopen("/tmp/frc_versions/FRC_Lib_Version.ini", "w");
|
||||
|
||||
if (file != nullptr) {
|
||||
fputs("2016 C++ Beta5.0", file);
|
||||
fputs("2016 C++ Release 3", file);
|
||||
fclose(file);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ protected:
|
||||
|
||||
static const int32_t kMaxNumberOfMotors = 4;
|
||||
|
||||
int32_t m_invertedMotors[kMaxNumberOfMotors];
|
||||
int32_t m_invertedMotors[kMaxNumberOfMotors] = {1,1,1,1};
|
||||
float m_sensitivity = 0.5;
|
||||
double m_maxOutput = 1.0;
|
||||
bool m_deleteSpeedControllers;
|
||||
|
||||
@@ -52,11 +52,6 @@ RobotDrive::RobotDrive(uint32_t leftMotorChannel, uint32_t rightMotorChannel)
|
||||
InitRobotDrive();
|
||||
m_rearLeftMotor = std::make_shared<Talon>(leftMotorChannel);
|
||||
m_rearRightMotor = std::make_shared<Talon>(rightMotorChannel);
|
||||
|
||||
for (int32_t i=0; i < kMaxNumberOfMotors; i++)
|
||||
{
|
||||
m_invertedMotors[i] = 1;
|
||||
}
|
||||
SetLeftRightMotorOutputs(0.0, 0.0);
|
||||
m_deleteSpeedControllers = true;
|
||||
}
|
||||
@@ -79,10 +74,6 @@ RobotDrive::RobotDrive(uint32_t frontLeftMotor, uint32_t rearLeftMotor,
|
||||
m_rearRightMotor = std::make_shared<Talon>(rearRightMotor);
|
||||
m_frontLeftMotor = std::make_shared<Talon>(frontLeftMotor);
|
||||
m_frontRightMotor = std::make_shared<Talon>(frontRightMotor);
|
||||
for (int32_t i=0; i < kMaxNumberOfMotors; i++)
|
||||
{
|
||||
m_invertedMotors[i] = 1;
|
||||
}
|
||||
SetLeftRightMotorOutputs(0.0, 0.0);
|
||||
m_deleteSpeedControllers = true;
|
||||
}
|
||||
|
||||
@@ -53,29 +53,8 @@ task wpilibjSimJavadocJar(type: Jar, dependsOn: wpilibjSimJavadoc) {
|
||||
from wpilibjSimJavadoc.destinationDir
|
||||
}
|
||||
|
||||
// Maven publishing configuration
|
||||
publishing {
|
||||
publications {
|
||||
wpilibjSim(MavenPublication) {
|
||||
artifact wpilibjSimJar {
|
||||
classifier = 'simulation'
|
||||
}
|
||||
artifact(wpilibjSimSources) {
|
||||
classifier = 'sources-simulation'
|
||||
}
|
||||
artifact(wpilibjSimJavadocJar) {
|
||||
classifier 'javadoc-simulation'
|
||||
}
|
||||
|
||||
groupId 'edu.wpi.first.wpilibj'
|
||||
artifactId 'wpilibJavaSim'
|
||||
version '0.1.0-SNAPSHOT'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//we need to move the simulation jars to the install directory
|
||||
task copyJars(type: Copy) {
|
||||
task copyJars(type: Copy, dependsOn: wpilibjSimJar) {
|
||||
description = 'copy wpilibj simulation jar to make simulation zip'
|
||||
group = 'WPILib Simulation'
|
||||
from wpilibjSimJar.archivePath
|
||||
|
||||
@@ -223,7 +223,7 @@ public abstract class RobotBase {
|
||||
|
||||
output = new FileOutputStream(file);
|
||||
|
||||
output.write("2016 Java Beta5.0".getBytes());
|
||||
output.write("2016 Java Release 3".getBytes());
|
||||
|
||||
} catch (IOException ex) {
|
||||
ex.printStackTrace();
|
||||
@@ -238,6 +238,7 @@ public abstract class RobotBase {
|
||||
|
||||
boolean errorOnExit = false;
|
||||
try {
|
||||
System.out.println("********** Robot program starting **********");
|
||||
robot.startCompetition();
|
||||
} catch (Throwable t) {
|
||||
DriverStation.reportError(
|
||||
|
||||
Reference in New Issue
Block a user