Go to Post Overall I really like the idea, and don't be surprised if I borrow some of these ideas for a future robot. - Greg Needel [more]
Home
Go Back   Chief Delphi > Technical > Programming > Python
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #3   Spotlight this post!  
Unread 31-01-2015, 00:10
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,043
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: CAN Jaguar

Quote:
Originally Posted by Pramizle View Post
My team is having extreme difficulty in regards to using the CAN Jaguar class. The current code that we are using to initialize it is:

self.jaguar = wpilib.CANJaguar(1,4)

From this line of code we get an error saying that two values are needed but that the code is entering in three.

Please help. We are completely lost and are losing hair as well as sleep.
The error message is correct. In python there is an implicit first parameter called 'self', so when you pass it 2 parameters, you actually passed it three.

Instead, you should initialize the CANJaguar like so:

Code:
self.jaguar = wpilib.CANJaguar(1)
As referenced in the RobotPy CANJaguar documentation, there's only a single parameter you need to pass to the CANJaguar object, which is the deviceNumber.

Make sure that you're using the very latest version of RobotPy, as the CANJaguar object has had a lot of bugfixes this season!

Quote:
Originally Posted by ozrien View Post
did you mean...
self.jaguar = new CANJaguar(1);
... your using java right?

Also I only see one param for the constructor. What is '4' supposed to be. I assume '1' is the device ID.
This is the python forum.
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
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 06:23.

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