View Single Post
  #3   Spotlight this post!  
Unread 17-01-2016, 22:59
Happy Birthday! rod@3711 rod@3711 is offline
Registered User
AKA: rod nelson
FRC #3711 (Iron Mustangs)
Team Role: Mentor
 
Join Date: May 2014
Rookie Year: 2014
Location: Trout Lake, WA
Posts: 64
rod@3711 is an unknown quantity at this point
Re: Shared pointers? Unique pointers?

I had asked a student to post this question, because I had given up and he was willing to work on it with no success.

We have used Robot Builder with enough success last year that we wanted to use it again this year. It is great for organizing command based code and is a tremendous testing tool. Normally you can export the c++ code, build it and deploy it and start testing motors and PID Loops. We just love it.

This year it did not work in Test Mode and with the help of Joe Ross (my hero), we had to make some changes to code generated by Robot Builder. Life was good and we have already been able to test motors and PID loop controls without have to write any C++ code (other than the Joe Ross fixes).

As shown in the original Brad Mill videos and as described in RobotBuilder, "Driving the robot with tank drive and joysticks", we had to write code to drive with joystick. Not being particularly bright, it usually takes us an hour or so to get it to build. This year I spent a couple hours and a student has spent a couple of hours without success. I am pretty sure that this has convinced him to give up the programming career and pursue Fine Arts.

Basically we designed a 2 motor drive subsystem (Chassis), a Joystick and a DriveWithJoystick command in Robot Builder then export (C++). We added the following method to our Chassis subsystem:

// Put methods for controlling this subsystem
// here. Call these from Commands.
void Chassis::SixDrive(Joystick driveStick){ // %seb17-1
tankdrive->ArcadeDrive(driveStick);

With a declaration in Chassis.h.

Then we added this code to DriveWithJoyStick command:

void Drivewithjoystick::Execute() {

Robot::chassis->SixDrive((Joystick)(Robot:i->getDriveJoystick()));
}

This gives us a Red X which displays the message:

Multiple markers at this line
- candidate is:
- no matching function for call to 'Chassis::SixDrive (std::shared_ptr<Joystick>'

So we tried random things for several hours, then our X student programmer posted the beginning of this thread.

Any help may get him to rethink his Fine Arts goal.

Thanx

Last edited by rod@3711 : 17-01-2016 at 23:02.
Reply With Quote