Go to Post Health. Family. School. FIRST. Any other order is a mistake. - pfreivald [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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 04-04-2015, 02:17
rellimcire rellimcire is offline
Robolopes Software Advisor
AKA: Eric Miller
FRC #2339 (Robolopes)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2008
Location: Lancaster, CA
Posts: 11
rellimcire is an unknown quantity at this point
Implementing Own Sendable

Has anyone ever implemented their own Sendable object in Java and used with the Smartdashboard?

I have tried and failed miserably. The behavior I see when I try to use my implementation is that dashboard locks up and fails to receive any data. Restarting the dashboard and removing use of my class seems to fix the problem.

Attached is my SendablePosition class. A trival sample usage would the following in robotInit.
Code:
Smartdashboard.putData("test posit ", new SendablePosition(0,0));
A more useful example would be the following in teleopPeriodic.
Code:
Smartdashboard.putData("joystick posit ", new SendablePosition(driveStick.getX(), driveStick.getY()));
(where "driveStick" is the joystick controlling our drive)

Has anyone else seen this behavior? Has anyone else tried anything like this?
Attached Files
File Type: java SendablePosition.java (1.3 KB, 12 views)
Reply With Quote
  #2   Spotlight this post!  
Unread 04-04-2015, 15:52
Ben Wolsieffer Ben Wolsieffer is offline
Dartmouth 2020
AKA: lopsided98
FRC #2084 (Robots by the C)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Manchester, MA (Hanover, NH)
Posts: 520
Ben Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud of
Re: Implementing Own Sendable

Have you created a Widget and type to view the position on the SmartDashboard? Without one, nothing should happen when you call "SmartDashboard.putData()", so I'm not sure why the SmartDashboard freezes.

We wrote a few Sendables for our robot, if you want to see examples:
WheelController
Robot Code (Sendable)
SmartDashboard Widget
SmartDashboard Type

ParameterCommand
Robot Code (Sendable)
SmartDashboard Widget
SmartDashboard Type

Let me know if you want explanations of how the code works.
__________________



2016 North Shore District - Semifinalists and Excellence in Engineering Award
2015 Northeastern University District - Semifinalists and Creativity Award
2014 Granite State District - Semifinalists and Innovation in Control Award
2012 Boston Regional - Finalists
Reply With Quote
  #3   Spotlight this post!  
Unread 05-04-2015, 10:42
rellimcire rellimcire is offline
Robolopes Software Advisor
AKA: Eric Miller
FRC #2339 (Robolopes)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2008
Location: Lancaster, CA
Posts: 11
rellimcire is an unknown quantity at this point
Re: Implementing Own Sendable

Thanks, very helpful. I missed entirely the need to create Smartdashboard widgets and types. Working my way through the docs and your code.
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 13:07.

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