Compare commits

...

12 Commits

Author SHA1 Message Date
Thomas Clark
f7e1753e03 Fix C++ linker settings
Change-Id: I980e00968b0b465e6bba26a6586e23cc4e20f320
2014-08-13 11:56:36 -04:00
Alex Henning
6b3e2690d0 Fixed placement of libWPILibAthena.a
Change-Id: Ie50de30bcf911149d18d96e2b510b34424177e15
2014-08-12 17:15:44 -04:00
Alex Henning
ae10d43900 Fixes for examples and Gazebo 3.1.
Change-Id: Ie41a29b4b8f5cee87357f44adb45f54e03487622
2014-08-12 15:47:10 -04:00
Thomas Clark (WPI)
d4e377fc0e Merge "Adds the Trigger template and adds WPILib.h import to all templates" 2014-08-12 12:33:46 -07:00
Jonathan Leitschuh
9126646fef Adds the Trigger template and adds WPILib.h import to all templates
Change-Id: Ibaecc4802822cf4c0a4a5bf9ddc960b96e40d1e9
2014-08-12 15:32:29 -04:00
Thomas Clark (WPI)
d3f632486f Merge "Added support for Jenkins to generate doxygen." 2014-08-12 12:22:53 -07:00
Alex Henning
268459206f Added support for Jenkins to generate doxygen.
Change-Id: I2febfe42cc9301446f796376cfe8e1ef6744f19a
2014-08-12 15:22:16 -04:00
Thomas Clark (WPI)
df390c275d Merge "Merged sources in wpilibJavaFinal." 2014-08-12 12:09:31 -07:00
Jonathan Leitschuh (WPI)
1742634a96 Merge "Fix the example programs" 2014-08-12 12:06:42 -07:00
Alex Henning
0f8f83500b Merged sources in wpilibJavaFinal.
Change-Id: Iab8d079716eae3e5631cf7a62d6e88340e55e03c
2014-08-12 14:59:16 -04:00
Thomas Clark
d5c73c95dc Fix the example programs
Remove the test examples that don't do anything helpful

Fix the PacGoat and GearsBot examples to compile

Change-Id: Ic11ca7a97a5b52524fe60dc24fcec6ecfae7ebb7
2014-08-12 14:52:22 -04:00
Alex Henning
ca7dc5d6ac Removed excessive linking.
Change-Id: Iffc8517da2a4d6b67612b6076023211c07768714
2014-08-12 12:07:09 -04:00
30 changed files with 4757 additions and 216 deletions

View File

@@ -39,7 +39,6 @@
<listOptionValue builtIn="false" value="$cpp-location/lib"/>
</option>
<option id="gnu.cpp.link.option.libs.1072058280" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
<listOptionValue builtIn="false" value="WPILib"/>
<listOptionValue builtIn="false" value="WPILibAthena"/>
<listOptionValue builtIn="false" value="WPILib"/>
<listOptionValue builtIn="false" value="HALAthena"/>
@@ -155,7 +154,7 @@
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/src&quot;"/>
<listOptionValue builtIn="false" value="$cpp-location/sim/include"/>
<listOptionValue builtIn="false" value="/usr/include"/>
<listOptionValue builtIn="false" value="/usr/include/gazebo-3.0"/>
<listOptionValue builtIn="false" value="/usr/include/gazebo-3.1"/>
<listOptionValue builtIn="false" value="/usr/include/sdformat-2.0"/>
</option>
<option id="gnu.cpp.compiler.option.optimization.level.1648211502" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>

View File

@@ -2,6 +2,7 @@
#define $classname_H
#include "../CommandBase.h"
#include "WPILib.h"
class $classname: public CommandBase
{

View File

@@ -5,6 +5,7 @@
#include "Commands/Command.h"
#include "Subsystems/ExampleSubsystem.h"
#include "OI.h"
#include "WPILib.h"
/**
* The base for all commands. All atomic commands should subclass CommandBase.

View File

@@ -2,6 +2,7 @@
#define $classname_H
#include "Commands/CommandGroup.h"
#include "WPILib.h"
class $classname: public CommandGroup
{

View File

@@ -2,6 +2,7 @@
#define EXAMPLE_COMMAND_H
#include "../CommandBase.h"
#include "WPILib.h"
class ExampleCommand: public CommandBase
{

View File

@@ -3,9 +3,6 @@
#include "SmartDashboard/SmartDashboard.h"
#include "LiveWindow/LiveWindow.h"
#@autogenerated_code("pid", "")
#parse("${exporter-path}PIDSubsystem-pid.cpp")
#end
$classname::$classname() :
PIDSubsystem("$classname", 1.0, 0.0, 0.0)
{

View File

@@ -1,6 +1,7 @@
#ifndef ROBOTMAP_H
#define ROBOTMAP_H
#include "WPILib.h"
/**
* The RobotMap is a mapping from the ports sensors and actuators are wired into

View File

@@ -1,15 +1,12 @@
// TODO: convert into C++ template
#error "This is not a C++ file. I have no idea what this is doing here, so I'm leaving this message here to let someone else clean this up"
import edu.wpi.first.wpilibj.command.Trigger;
#include "$classname.h"
/**
* New and improved C++
*/
public class $classname extends Trigger
$classname::$classname()
{
public:
bool get()
{
return false;
}
}
bool $classname::Get()
{
return false;
}

View File

@@ -1,9 +1,13 @@
// TODO: convert into C++ template
#error "This is not a C++ file. I have no idea what this is doing here, so I'm leaving this message here to let someone else clean this up"
import edu.wpi.first.wpilibj.command.Trigger;
#ifndef $classname_H
#define $classname_H
public class $classname extends Trigger
#include "WPILib.h"
class $classname: public Trigger
{
public:
bool get();
}
$classname();
bool Get();
};
#endif

View File

@@ -26,9 +26,6 @@ DriveTrain::DriveTrain() : Subsystem("DriveTrain") {
right_encoder->SetDistancePerPulse((double) (4.0/12.0*M_PI) / 360.0);
#endif
left_encoder->Start();
right_encoder->Start();
rangefinder = new AnalogInput(6);
gyro = new Gyro(1);

View File

@@ -1,7 +1,6 @@
#ifndef DriveTrain_H
#define DriveTrain_H
#include "Commands/Subsystem.h"
#include "WPILib.h"
/**

View File

@@ -1,24 +0,0 @@
#include <networktables/NetworkTable.h>
#include <iostream>
using namespace std;
// This is a simple robot program
int main()
{
NetworkTable::SetServerMode();
NetworkTable::SetTeam(190);
NetworkTable* table = NetworkTable::GetTable("SmartDashboard");
cout << "Started up" << endl;
long i = 0;
while (true)
{
cout << i << endl;
table->PutNumber("i", i);
i++;
sleep(1);
}
return 0;
}

View File

@@ -9,7 +9,7 @@
* points than get none. When called sequentially, this command will block until
* the hot goal is detected or until it is timed out.
*/
class CheckForHotGoal : Command {
class CheckForHotGoal : public Command {
public:
CheckForHotGoal(double time);
void Initialize();

View File

@@ -6,6 +6,7 @@
#include "Commands/SetPivotSetpoint.h"
#include "Commands/DriveForward.h"
#include "Commands/Shoot.h"
#include "Commands/CheckForHotGoal.h"
DriveAndShootAutonomous::DriveAndShootAutonomous() {
AddSequential(new CloseClaw());

View File

@@ -43,8 +43,6 @@ DriveTrain::DriveTrain() :
leftEncoder->SetDistancePerPulse((4.0/*in*/*M_PI)/(360.0*12.0/*in/ft*/));
#endif
rightEncoder->Start();
leftEncoder->Start();
LiveWindow::GetInstance()->AddSensor("DriveTrain", "Right Encoder", rightEncoder);
LiveWindow::GetInstance()->AddSensor("DriveTrain", "Left Encoder", leftEncoder);

View File

@@ -1,17 +0,0 @@
package $package;
/**
* Simplest possible robot program
*
* @author Team $team-number
*/
public class Robot {
/**
* @param args Input....
*/
public static void main(String[] args) {
// Do stuff here!
}
}

View File

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<examples>
<!-- TODO add back in when there are enough samples to justify tags
<tagDescription>
<name>Simple Robot</name>
<description>Examples for simple robot programs.</description>
@@ -10,47 +11,14 @@
variety of tasks such as sending and receiving values to both
dashboards and co-processors.</description>
</tagDescription>
<tagDescription>
<name>Simulation</name>
<description>Examples that can be run in simulation.</description>
</tagDescription>-->
<tagDescription>
<name>CommandBased Robot</name>
<description>Examples for CommandBased robot programs.</description>
</tagDescription>
<tagDescription>
<name>Simulation</name>
<description>Examples that can be run in simulation.</description>
</tagDescription>
<example>
<name>Simple Robot Example</name>
<description>The simplest possible program that compiles. This
shows the structure of a simple program that does nothing at
all.</description>
<tags>
<tag>Simple Robot</tag>
</tags>
<packages>
<package>src</package>
</packages>
<files>
<file source="examples/Simple Robot Example/Robot.java" destination="src/Robot.cpp" />
</files>
</example>
<example>
<name>Network Table Counter</name>
<description>A simple program that increments a network table
variable once every second. This shows the structure of a simple
program that only uses network tables.</description>
<tags>
<tag>Simple Robot</tag>
<tag>Network Tables</tag>
</tags>
<packages>
<package>src</package>
</packages>
<files>
<file source="examples/Network Table Counter/Robot.cpp" destination="src/Robot.cpp" />
</files>
</example>
<example>
<name>GearsBot</name>
@@ -59,7 +27,6 @@
supports simulation.</description>
<tags>
<tag>CommandBased Robot</tag>
<tag>Simulation</tag>
</tags>
<packages>
<package>src</package>
@@ -137,14 +104,12 @@
destination="src/Subsystems/Wrist.h"></file>
</files>
</example>
<example>
<name>PacGoat</name>
<description>A fully functional example CommandBased program for FRC Team 190&#39;s 2014 robot. This code can run on your computer if it supports simulation.</description>
<tags>
<tag>CommandBased Robot</tag>
<tag>Simulation</tag>
<tag>2014 Season</tag>
</tags>
<packages>
<package>src</package>

View File

@@ -92,7 +92,7 @@
</artifactItem>
<artifactItem>
<groupId>edu.wpi.first.wpilibj</groupId>
<artifactId>wpilibJavaDevices</artifactId>
<artifactId>wpilibJavaFinal</artifactId>
<version>0.1.0-SNAPSHOT</version>
<classifier>sources</classifier>
<outputDirectory>${java-zip}/lib</outputDirectory>
@@ -107,6 +107,13 @@
<type>javadoc</type>
<outputDirectory>${java-zip}/javadoc-jar</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>edu.wpi.first.wpilibj</groupId>
<artifactId>wpilibJava</artifactId>
<version>0.1.0-SNAPSHOT</version>
<type>javadoc</type>
<outputDirectory>${java-zip}/javadoc-jar</outputDirectory>
</artifactItem>
</artifactItems>
<overWriteReleases>false</overWriteReleases>
@@ -329,6 +336,12 @@
<version>0.1.0-SNAPSHOT</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>edu.wpi.first.wpilibj</groupId>
<artifactId>wpilibJavaFinal</artifactId>
<version>0.1.0-SNAPSHOT</version>
<classifier>sources</classifier>
</dependency>
<!-- dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
@@ -361,6 +374,12 @@
</dependency>
<!-- Javadoc -->
<dependency>
<groupId>edu.wpi.first.wpilibj</groupId>
<artifactId>wpilibJava</artifactId>
<version>0.1.0-SNAPSHOT</version>
<type>javadoc</type>
</dependency>
<dependency>
<groupId>edu.wpi.first.wpilibj</groupId>
<artifactId>wpilibJavaDevices</artifactId>

View File

@@ -1,39 +0,0 @@
package $package;
import edu.wpi.first.wpilibj.networktables.NetworkTable;
/**
* An example of a network table counter.
*
* @author Team $team-number
*/
public class Robot {
private static NetworkTable table;
/**
* @param args
*/
public static void main(String[] args) {
NetworkTable.setServerMode();
NetworkTable.setTeam(190);
table = NetworkTable.getTable("SmartDashboard");
System.out.println("Started up");
long i = 0;
while (true) {
System.out.println(i);
table.putNumber("i", i);
i++;
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}

View File

@@ -1,17 +0,0 @@
package $package;
/**
* Simplest possible robot program
*
* @author Team $team-number
*/
public class Robot {
/**
* @param args Input....
*/
public static void main(String[] args) {
// Do stuff here!
}
}

View File

@@ -1,63 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<examples>
<!-- TODO add back in when there are enough samples to justify tags
<tagDescription>
<name>Simple Robot</name>
<description>Examples for simple robot programs.</description>
</tagDescription>
<tagDescription>
<name>CommandBased Robot</name>
<description>Examples for CommandBased robot programs.</description>
</tagDescription>
<tagDescription>
<name>Simulation</name>
<description>Examples that can be run in simulation.</description>
</tagDescription>
<tagDescription>
<name>Network Tables</name>
<description>Examples of how to use Network Tables to accomplish a
variety of tasks such as sending and receiving values to both
dashboards and co-processors.</description>
</tagDescription>
<example>
<name>Simple Robot Example</name>
<description>The simplest possible program that compiles. This
shows the structure of a simple program that does nothing at
all.</description>
<tags>
<tag>Simple Robot</tag>
</tags>
<packages>
<package>src/$package-dir</package>
</packages>
<files>
<file source="examples/Simple Robot Example/Robot.java" destination="src/$package-dir/Robot.java" />
</files>
</example>
<example>
<name>Network Table Counter</name>
<description>A simple program that increments a network table
variable once every second. This shows the structure of a simple
program that only uses network tables.</description>
<tags>
<tag>Simple Robot</tag>
<tag>Network Tables</tag>
</tags>
<packages>
<package>src/$package-dir</package>
</packages>
<files>
<file source="examples/Network Table Counter/Robot.java" destination="src/$package-dir/Robot.java" />
</files>
</example>
<tagDescription>
<name>Simulation</name>
<description>Examples that can be run in simulation.</description>
</tagDescription>-->
<tagDescription>
<name>CommandBased Robot</name>
<description>Examples for CommandBased robot programs.</description>
</tagDescription>
<example>
<name>GearsBot</name>
<description>A fully functional example CommandBased program for WPIs GearsBot robot. This code can run on your computer if it supports simulation.</description>
<tags>
<tag>CommandBased Robot</tag>
<tag>Simulation</tag>
</tags>
<packages>
<package>src/$package-dir</package>
@@ -90,8 +57,6 @@
<description>A fully functional example CommandBased program for FRC Team 190&#39;s 2014 robot. This code can run on your computer if it supports simulation.</description>
<tags>
<tag>CommandBased Robot</tag>
<tag>Simulation</tag>
<tag>2014 Season</tag>
</tags>
<packages>
<package>src/$package-dir</package>

1
jenkins/README Normal file
View File

@@ -0,0 +1 @@
This directory contains special jenkins build options.

2
jenkins/docs/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
build/
site/

32
jenkins/docs/Makefile Normal file
View File

@@ -0,0 +1,32 @@
allwpilib=../..
version=DEVELOPMENT
all: java cpp site
java:
mkdir -p build/java/
mkdir -p site/java/
cp -r $(allwpilib)/wpilibj/wpilibJava/src/main/java/* build/java/
cp -r $(allwpilib)/wpilibj/wpilibJavaDevices/src/main/java/* build/java/
# cp -r $(allwpilib)/networktables/java/src/main/java/* build/java/
( cat java.doxy ; echo "PROJECT_NUMBER=${version}" ) | doxygen -
cpp:
mkdir -p build/cpp/
mkdir -p site/cpp/
cp -r $(allwpilib)/wpilibc/wpilibC++/src build/cpp/
cp -r $(allwpilib)/wpilibc/wpilibC++/include build/cpp/
cp -r $(allwpilib)/wpilibc/wpilibC++Devices/src build/cpp/
cp -r $(allwpilib)/wpilibc/wpilibC++Devices/include build/cpp/
# cp -r $(allwpilib)/networktables/cpp/lib build/cpp/
# cp -r $(allwpilib)/networktables/cpp/include build/cpp/
( cat cpp.doxy ; echo "PROJECT_NUMBER=${version}" ) | doxygen -
# TODO: HAL
site:
mkdir -p build/site/
clean:
rm -rf build/
rm -rf site/

2305
jenkins/docs/cpp.doxy Normal file

File diff suppressed because it is too large Load Diff

2303
jenkins/docs/java.doxy Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,7 @@ include_directories(include/ ${NWT_API_INCLUDES} ${HAL_API_INCLUDES})
add_library(WPILib STATIC ${SRC_FILES})
set(CMAKE_CXX_FLAGS "-fPIC")
target_link_libraries(WPILib)
INSTALL(TARGETS WPILib ARCHIVE DESTINATION src COMPONENT src)
INSTALL(TARGETS WPILib ARCHIVE DESTINATION lib COMPONENT lib)
INSTALL(DIRECTORY include DESTINATION ${CMAKE_INSTALL_PREFIX} COMPONENT headers)
# lib/ c m gcc_s ld-linux
# usr/lib stdc++

View File

@@ -5,7 +5,7 @@ file(GLOB_RECURSE SRC_FILES src/*.cpp)
include_directories(include/ ${WPILIB_INCLUDES} ${HAL_API_INCLUDES} ${NWT_API_INCLUDES})
add_library(WPILibAthena STATIC ${SRC_FILES})
target_link_libraries(WPILibAthena WPILib HALAthena NetworkTables ${NI_LIBS})
INSTALL(TARGETS WPILibAthena ARCHIVE DESTINATION src COMPONENT src)
INSTALL(TARGETS WPILibAthena ARCHIVE DESTINATION lib COMPONENT lib)
INSTALL(DIRECTORY include DESTINATION ${CMAKE_INSTALL_PREFIX} COMPONENT headers)
# lib/ c m gcc_s ld-linux
# usr/lib stdc++

View File

@@ -63,6 +63,18 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<sourceFileExcludes>
<exclude>edu/wpi/first/wpilibj/image/</exclude>
<exclude>edu/wpi/first/wpilibj/camera/</exclude>
<exclude>edu/wpi/first/wpilibj/visa/</exclude>
<exclude>edu/wpi/first/wpilibj/SerialPort.java</exclude>
</sourceFileExcludes>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@@ -30,7 +30,20 @@
<artifactId>wpilibJavaJNI</artifactId>
<version>0.1.0-SNAPSHOT</version>
<type>so</type>
</dependency>
</dependency>
<dependency>
<groupId>edu.wpi.first.wpilibj</groupId>
<artifactId>wpilibJava</artifactId>
<version>0.1.0-SNAPSHOT</version>
<classifier>sources</classifier>
</dependency>
<dependency>
<groupId>edu.wpi.first.wpilibj</groupId>
<artifactId>wpilibJavaDevices</artifactId>
<version>0.1.0-SNAPSHOT</version>
<classifier>sources</classifier>
</dependency>
</dependencies>
<build>
@@ -99,6 +112,30 @@
</target>
</configuration>
</execution>
<execution>
<id>generate-sources</id>
<goals>
<goal>run</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<target>
<taskdef resource="net/sf/antcontrib/antcontrib.properties"
classpathref="maven.plugin.classpath" />
<mkdir dir="${project.build.directory}/sources" />
<property name="mvn.wpilibJava.sources.path" value="${edu.wpi.first.wpilibj:wpilibJava:jar:sources}"/>
<unzip src="${mvn.wpilibJava.sources.path}" dest="${project.build.directory}/sources" />
<property name="mvn.wpilibJavaDevices.sources.path" value="${edu.wpi.first.wpilibj:wpilibJavaDevices:jar:sources}"/>
<unzip src="${mvn.wpilibJavaDevices.sources.path}" dest="${project.build.directory}/sources" />
<zip basedir="${project.build.directory}/sources" destfile="${project.build.directory}/sources.jar"/>
<attachartifact file="${project.build.directory}/sources.jar" classifier="sources" type="jar" />
</target>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>