View Single Post
  #8   Spotlight this post!  
Unread 14-01-2016, 10:45
SLAB-Mr.Thomas SLAB-Mr.Thomas is offline
Registered User
FRC #4237
 
Join Date: Jan 2015
Location: USA
Posts: 12
SLAB-Mr.Thomas is an unknown quantity at this point
Re: Strange issue with pushing code and running it on 2016 firmware

SIMPLIFIED ERROR DEMO:
Here's the simplest program I find works or doesn't work. Offending statement commented or not.

It doesn't seem to matter if Smart Dashboard is open or not. What is critical is the roboRIO COMM LED is red thus causing the driver station to think there is No Robot Code if there is no SendableChooser object.

This works:
#include "WPILib.h"

class Robot: public SampleRobot
{
SendableChooser *chooser;

public:
Robot()
:chooser()
{
}

void RobotInit()
{
chooser = new SendableChooser();
}
};

START_ROBOT_CLASS(Robot)
====================
This does not work:
#include "WPILib.h"

class Robot: public SampleRobot
{
SendableChooser *chooser;

public:
Robot()
:chooser()
{
}

void RobotInit()
{
//chooser = new SendableChooser(); Need this statement to keep Comm LED Green. If new chooser missing, then LED is Red.
}
};

START_ROBOT_CLASS(Robot)

===============
This doesn't work either lest you think there is some sort of dangling object:
#include "WPILib.h"

class Robot: public SampleRobot
{
//SendableChooser *chooser;

public:
Robot()
//:chooser()
{
}

void RobotInit()
{
//chooser = new SendableChooser();
}
};

START_ROBOT_CLASS(Robot)
======
Side note for person concerned about looping in RobotInit. It's okay - it's just to enter Preferences and we don't drive in RobotInit. Thanks for taking the time to think about us.

I hope this example gets FIRST to an early resolution. Maybe we have a circumvention for now - add a SendableChooser to our programs? I'll be trying that soon.

I verified that adding the minimal 3 lines of code for SendableChooser object does make a complex 2015 Robot code work on 2016.

Last edited by SLAB-Mr.Thomas : 14-01-2016 at 16:50. Reason: follow up on completed task; improve clarity
Reply With Quote