Go to Post I should have gone to IRI years ago. - Richard Wallace [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

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 28-01-2017, 14:16
ebernerrd ebernerrd is offline
Registered User
FRC #3236
 
Join Date: Jan 2017
Location: Franklin, MA
Posts: 8
ebernerrd is an unknown quantity at this point
Re: SendableChoosers are causing me grief!

Quote:
Originally Posted by ebernerrd View Post
I get the errors "Symbol SendableChooser could not be resolved" and "Type ::Command could not be resolved"

I've actually gone and fixed these issues. When I write the code as you did, I get an error on SmartDashboard:utData("Auto modes", &autonomousChooser);

The error I have is:

invalid arguments
Candidates are:
void PutData(llvm::StringRef, frc::Sendable *)
void PutData(frc::NamedSendable *)
Reply With Quote
  #2   Spotlight this post!  
Unread 29-01-2017, 13:16
bob.wolff68's Avatar
bob.wolff68 bob.wolff68 is offline
Da' Mentor Man
FRC #1967
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2007
Location: United States
Posts: 158
bob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nice
Re: SendableChoosers are causing me grief!

Quote:
Originally Posted by ebernerrd View Post
I've actually gone and fixed these issues. When I write the code as you did, I get an error on SmartDashboard:utData("Auto modes", &autonomousChooser);

The error I have is:

invalid arguments
Candidates are:
void PutData(llvm::StringRef, frc::Sendable *)
void PutData(frc::NamedSendable *)
autonomousChoose was defined as a pointer already "SendableChooser<Command *> *autonomousChooser"

while the other team's example was NOT a pointer (no * before the variable name).

As such, PutData is looking for a pointer to be sent to it... so you should not preceed it with & but instead just give the name of the variable (the pointer). The other team needs the & in order to give an address (pointer) to PutData. I believe if you remove the & you'll be good there.

BTW, don't forget to 'new' any pointers before using them and 'delete' them at the end in some destructor like ~Robot()
__________________
~~~~~~~~~~~~~~~~~~~
Bob Wolff - Software from the old-school
Mentor / C / C++ guy
Team 1967 - The Janksters - San Jose, CA
Reply With Quote
Reply


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 09:56.

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