Go to Post I HAVE ENERGY DRINKS AND STARBUCKS COFFEE!!! I'M READY!!! - looneylin [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 17-01-2016, 19:54
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
Shared pointers? Unique pointers?

We're having some issues getting the code to work. It seems that this year's coding approach is different than last year's.
What are shared pointers for?
The problem arose when we were attempting to get the value of the joystick.

Code:
void Chassis::SixDrive(std::shared_ptr<Joystick>& stickPosition){  
	tankdrive->ArcadeDrive(stickPosition->GetX(), stickPosition->GetZ());
}
Code:
void Drivewithjoystick::Execute() {
	Robot::chassis->SixDrive(Robot::oi->getDriveJoystick());
}
This is where our problem is, when referencing the drivejoystick, it seems we have a shared_ptr issue.

Declaration of the joystick
Code:
std::shared_ptr<Joystick> OI::getDriveJoystick() {
   return driveJoystick;
}

Thank you!
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 12:02.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi