Yesterday, we ran into an issue of our code not being deployed to the roboRio. Eclipse told us that the build was successful, however the comm light on the roboRio stays solid red and blinks about every 12 seconds and the driver station says there’s no robot code.
Here is the build log:
Buildfile: C:\Users\FRCrobotics988\Desktop\NEW\MecanumDrive\build.xml
Trying to override old definition of task classloader
get-target-ip:
[echo] Finding roboRIO, please ignore any [hostinfo] error messages
[echo] Trying mDNS: roboRIO-988-FRC.local
[echo] Trying DNS: roboRIO-988-FRC.lan
[echo] Trying USB: 172.22.11.2
[hostinfo] Error retrieving remote host information for host:roboRIO-988-FRC.lan.
[echo] Trying Static Ethernet: 10.9.88.2
[echo] roboRIO found at 172.22.11.2
dependencies:
[echo] roboRIO image version validated
deploy:
[delete] Deleting: C:\Users\FRCrobotics988\wpilib\cpp\current\lib\WPI_Native_Libraries.properties
[scp] Connecting to 172.22.11.2:22
[scp] Receiving file: /usr/local/frc/lib/WPI_Native_Libraries.properties
[scp] Receiving: WPI_Native_Libraries.properties : 5125
[scp] File transfer time: 0.01 Average Rate: 1,025,000.0 B/s
[scp] done
[scp] Connecting to 172.22.11.2:22
[scp] Receiving file: /usr/local/frc/lib/User_Libraries.properties
[scp] Caught exception: scp: /usr/local/frc/lib/User_Libraries.properties: No such file or directory
[sshexec] Connecting to 172.22.11.2:22
[sshexec] cmd : rm -f /home/lvuser/FRCUserProgram
[sshexec] Connecting to 172.22.11.2:22
[sshexec] cmd : ldconfig
[echo] [athena-deploy] Copying code over.
[scp] Connecting to 172.22.11.2:22
[scp] done.
[sshexec] Connecting to 172.22.11.2:22
[sshexec] cmd : killall -q netconsole-host || :
[delete] Deleting: C:\Users\FRCrobotics988\wpilib\cpp\current\ant
etconsole-host.properties
[scp] Connecting to 172.22.11.2:22
[scp] Receiving file: /usr/local/frc/bin/netconsole-host.properties
[scp] Receiving: netconsole-host.properties : 242
[scp] File transfer time: 0.0 Average Rate: 242,000.0 B/s
[scp] done
[scp] Connecting to 172.22.11.2:22
[scp] done.
[echo] [athena-deploy] Giving program CAP_SYS_NICE capability.
[sshexec] Connecting to 172.22.11.2:22
[sshexec] cmd : setcap 'cap_sys_nice=pe' /home/lvuser/FRCUserProgram
[echo] Resolved mDNS to 172.22.11.2
[echo] [athena-deploy] Starting program.
[sshexec] Connecting to 172.22.11.2:22
[sshexec] cmd : . /etc/profile.d/natinst-path.sh; chmod a+x /home/lvuser/FRCUserProgram; /usr/local/frc/bin/frcKillRobot.sh -t -r;
[sshexec] Connecting to 172.22.11.2:22
[sshexec] cmd : sync
BUILD SUCCESSFUL
Total time: 10 seconds
We’ve deployed other C++ and Java codes and they work. Here is a build log of a successful program:
Buildfile: C:\Users\FRCrobotics988\Desktop\NEW\Motor Controller\build.xml
Trying to override old definition of task classloader
get-target-ip:
[echo] Finding roboRIO, please ignore any [hostinfo] error messages
[echo] Trying DNS: roboRIO-988-FRC.lan
[echo] Trying mDNS: roboRIO-988-FRC.local
[echo] Trying USB: 172.22.11.2
[echo] Trying Static Ethernet: 10.9.88.2
[hostinfo] Error retrieving remote host information for host:roboRIO-988-FRC.lan.
[echo] roboRIO found at 172.22.11.2
dependencies:
[echo] roboRIO image version validated
deploy:
[delete] Deleting: C:\Users\FRCrobotics988\wpilib\cpp\current\lib\WPI_Native_Libraries.properties
[scp] Connecting to 172.22.11.2:22
[scp] Receiving file: /usr/local/frc/lib/WPI_Native_Libraries.properties
[scp] Receiving: WPI_Native_Libraries.properties : 5125
[scp] File transfer time: 0.01 Average Rate: 854,166.67 B/s
[scp] done
[scp] Connecting to 172.22.11.2:22
[scp] Receiving file: /usr/local/frc/lib/User_Libraries.properties
[scp] Caught exception: scp: /usr/local/frc/lib/User_Libraries.properties: No such file or directory
[sshexec] Connecting to 172.22.11.2:22
[sshexec] cmd : rm -f /home/lvuser/FRCUserProgram
[sshexec] Connecting to 172.22.11.2:22
[sshexec] cmd : ldconfig
[echo] [athena-deploy] Copying code over.
[scp] Connecting to 172.22.11.2:22
[scp] done.
[sshexec] Connecting to 172.22.11.2:22
[sshexec] cmd : killall -q netconsole-host || :
[delete] Deleting: C:\Users\FRCrobotics988\wpilib\cpp\current\ant
etconsole-host.properties
[scp] Connecting to 172.22.11.2:22
[scp] Receiving file: /usr/local/frc/bin/netconsole-host.properties
[scp] Receiving: netconsole-host.properties : 242
[scp] File transfer time: 0.0 Average Rate: 242,000.0 B/s
[scp] done
[scp] Connecting to 172.22.11.2:22
[scp] done.
[echo] [athena-deploy] Giving program CAP_SYS_NICE capability.
[sshexec] Connecting to 172.22.11.2:22
[sshexec] cmd : setcap 'cap_sys_nice=pe' /home/lvuser/FRCUserProgram
[echo] Resolved mDNS to 172.22.11.2
[echo] [athena-deploy] Starting program.
[sshexec] Connecting to 172.22.11.2:22
[sshexec] cmd : . /etc/profile.d/natinst-path.sh; chmod a+x /home/lvuser/FRCUserProgram; /usr/local/frc/bin/frcKillRobot.sh -t -r;
[sshexec] Connecting to 172.22.11.2:22
[sshexec] cmd : sync
BUILD SUCCESSFUL
Total time: 10 seconds
We’re not sure what is happening. We’ve checked that the roborio and driver station are all up to date with their firmwares/softwares. We suspect that it’s an issue with the code, so this is our code:
#include <iostream>
#include <memory>
#include <string>
#include <Joystick.h>
#include <SampleRobot.h>
#include <SmartDashboard/SendableChooser.h>
#include <SmartDashboard/SmartDashboard.h>
#include <RobotDrive.h>
#include <Timer.h>
#include <VictorSP.h>
/**
* This is a demo program showing the use of the RobotDrive class.
* The SampleRobot class is the base of a robot application that will
* automatically call your Autonomous and OperatorControl methods at the right
* time as controlled by the switches on the driver station or the field
* controls.
*
* WARNING: While it may look like a good choice to use for your code if you're
* inexperienced, don't. Unless you know what you are doing, complex code will
* be much more difficult under this system. Use IterativeRobot or Command-Based
* instead if you're new.
*/
class Robot: public frc::SampleRobot {
private:
Joystick *stick; // only joystick
frc::SendableChooser<std::string> chooser;
const std::string autoNameDefault = "Default";
const std::string autoNameCustom = "My Auto";
frc::VictorSP *lf_motor, *rf_motor, *lr_motor, *rr_motor;
RobotDrive *myRobot; // robot drive system
// Update every 0.005 seconds/5 milliseconds.
static constexpr double kUpdatePeriod = 0.005;
public:
Robot() {
//Note SmartDashboard is not initialized here, wait until RobotInit to make SmartDashboard calls
myRobot->SetExpiration(0.1); //make sure this is a RobotDrive use
lf_motor = new VictorSP(0);
rf_motor = new VictorSP(1);
lr_motor = new VictorSP(2);
rr_motor = new VictorSP(3);
myRobot = new RobotDrive(lf_motor,rf_motor,lr_motor,rr_motor);
stick = new Joystick(0);
}
void Disabled()
{
while(IsDisabled())
{
}
}
void RobotInit() {
chooser.AddDefault(autoNameDefault, autoNameDefault);
chooser.AddObject(autoNameCustom, autoNameCustom);
frc::SmartDashboard::PutData("Auto Modes", &chooser);
}
/*
* This autonomous (along with the chooser code above) shows how to select
* between different autonomous modes using the dashboard. The sendable
* chooser code works with the Java SmartDashboard. If you prefer the
* LabVIEW Dashboard, remove all of the chooser code and uncomment the
* GetString line to get the auto name from the text box below the Gyro.
*
* You can add additional auto modes by adding additional comparisons to the
* if-else structure below with additional strings. If using the
* SendableChooser make sure to add them to the chooser code above as well.
*/
void Autonomous() {
auto autoSelected = chooser.GetSelected();
// std::string autoSelected = frc::SmartDashboard::GetString("Auto Selector", autoNameDefault);
std::cout << "Auto selected: " << autoSelected << std::endl;
if (autoSelected == autoNameCustom) {
// Custom Auto goes here
std::cout << "Running custom Autonomous" << std::endl;
myRobot->SetSafetyEnabled(false);
myRobot->MecanumDrive_Cartesian(0.0,0.0,0.5,0.0); // spin at half speed
frc::Wait(2.0); // for 2 seconds
myRobot->MecanumDrive_Cartesian(0.0,0.0,0.0,0.0); // stop robot
} else {
// Default Auto goes here
std::cout << "Running default Autonomous" << std::endl;
myRobot->SetSafetyEnabled(false);
myRobot->Drive(-0.5, 0.0); // drive forwards half speed
frc::Wait(2.0); // for 2 seconds
myRobot->Drive(0.0, 0.0); // stop robot
}
}
/*
* Runs the motors with arcade steering.
*/
void OperatorControl() override {
myRobot->SetSafetyEnabled(true);
while (IsOperatorControl() && IsEnabled()) {
// drive with arcade style (use right stick)
myRobot->MecanumDrive_Cartesian(stick->GetX(), stick->GetY(), stick->GetTwist());
//fl_motor -> Set(stick.GetRawAxis(0));
// wait for a motor update time
frc::Wait(kUpdatePeriod);
}
}
/*
* Runs during test mode
*/
void Test() override {
}
};
START_ROBOT_CLASS(Robot)
Any suggestions will be welcome.