View Single Post
  #4   Spotlight this post!  
Unread 17-01-2016, 16:09
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,561
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Robotbuilder c++ code dies in Test Mode

Quote:
Originally Posted by mathmogul View Post
Is subsystem1SpeedController1 an object or pointer to an object? If the suggested code is correct, then subsystem1SpeedController1 is a pointer and casting to Talon& seems strange to me anyway.
Here's the full code as RobotBuilder generated (minus the comments)

Code:
#include "RobotMap.h"
#include "LiveWindow/LiveWindow.h"

std::shared_ptr<SpeedController> RobotMap::subsystem1SpeedController1;
void RobotMap::init() {

    LiveWindow *lw = LiveWindow::GetInstance();

    subsystem1SpeedController1.reset(new Talon(0));
    lw->AddActuator("Subsystem 1", "Speed Controller 1", (Talon&) subsystem1SpeedController1);
}

Last edited by Joe Ross : 18-01-2016 at 00:10.
Reply With Quote