Go to Post I would love access to the crystal ball granting you the insight into these changes. - sdcantrell56 [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 08-02-2014, 10:36
E, Palmer E, Palmer is offline
Registered User
FRC #6239 (The Irrational Engineers)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2009
Location: Maryland
Posts: 15
E, Palmer will become famous soon enoughE, Palmer will become famous soon enough
CPP to Java

My issue is that my programming team has written our video processing program in CPP. However our robot and smartdashboard are written in java.

We need to send a Boolean from our video processing to our autonomous program. I do not know how to convert the CPP Boolean to a java program. Any help would be awesome.
  #2   Spotlight this post!  
Unread 08-02-2014, 10:49
xXhunter47Xx's Avatar
xXhunter47Xx xXhunter47Xx is offline
Lord of Lazy
AKA: Austin $wagmaster1337
FRC #4738 (Patribots)
Team Role: College Student
 
Join Date: Jan 2014
Rookie Year: 2013
Location: San Diego
Posts: 305
xXhunter47Xx will become famous soon enough
Re: CPP to Java

Quote:
Originally Posted by E, Palmer View Post
My issue is that my programming team has written our video processing program in CPP. However our robot and smartdashboard are written in java.

We need to send a Boolean from our video processing to our autonomous program. I do not know how to convert the CPP Boolean to a java program. Any help would be awesome.
What do you mean smartdashboard is written in Java?
You can always reimage the cRIO to C if that is what you mean by "robot written in java".

Last edited by xXhunter47Xx : 08-02-2014 at 11:21.
  #3   Spotlight this post!  
Unread 08-02-2014, 11:09
calcmogul's Avatar
calcmogul calcmogul is offline
WPILib Developer
AKA: Tyler Veness
FRC #3512 (Spartatroniks)
Team Role: Mentor
 
Join Date: Nov 2011
Rookie Year: 2012
Location: Santa Maria, CA
Posts: 52
calcmogul is just really nicecalcmogul is just really nicecalcmogul is just really nicecalcmogul is just really nice
Re: CPP to Java

The chunk of data which is the boolean doesn't have to be converted to a "Java program". For sending some data from the Driver Station to the robot, one could use sockets.

Basically, one opens a UDP socket on the Driver Station side and sends the data through. The robot side should have a UDP socket open and bound to some port like 1130 to which the Driver Station app is sending. I would recommend sending a character for something like that rather than a boolean since there isn't a defined format for booleans.
  #4   Spotlight this post!  
Unread 08-02-2014, 11:51
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,600
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: CPP to Java

Quote:
Originally Posted by mathmogul View Post
Basically, one opens a UDP socket on the Driver Station side and sends the data through. The robot side should have a UDP socket open and bound to some port like 1130 to which the Driver Station app is sending. I would recommend sending a character for something like that rather than a boolean since there isn't a defined format for booleans.
The JVM used for java on the cRIO doesn't support UDP, so TCP would have to be used for this approach.
  #5   Spotlight this post!  
Unread 08-02-2014, 12:30
E, Palmer E, Palmer is offline
Registered User
FRC #6239 (The Irrational Engineers)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2009
Location: Maryland
Posts: 15
E, Palmer will become famous soon enoughE, Palmer will become famous soon enough
Re: CPP to Java

Sorry if I was unclear. All of our dive code/autonomous is in Java so the crio is flashed to java. We are using the Java smartdashboard.

Our autonomous program needs to know if the goal is hot or not. The video processing will tell us that . So I need to send a Boolean between the CPP video processing to the Java autonomous telling whether the goal is hot or not.
  #6   Spotlight this post!  
Unread 08-02-2014, 12:33
MoosingIn3space MoosingIn3space is offline
Programming Division Captain
FRC #3334 (Eagle Robotics)
 
Join Date: Jul 2013
Rookie Year: 2012
Location: Salt Lake City, UT
Posts: 13
MoosingIn3space is an unknown quantity at this point
Look at Boost.Asio for sending data. Use a threaded socket communication layer to keep a connection open continuously so you can receive TCP messages from the C++ program.
  #7   Spotlight this post!  
Unread 08-02-2014, 12:54
vinnie's Avatar
vinnie vinnie is offline
Registered User
FRC #3309 (Friarbots)
Team Role: College Student
 
Join Date: Oct 2010
Rookie Year: 2010
Location: Los Angeles / Anaheim
Posts: 107
vinnie has a reputation beyond reputevinnie has a reputation beyond reputevinnie has a reputation beyond reputevinnie has a reputation beyond reputevinnie has a reputation beyond reputevinnie has a reputation beyond reputevinnie has a reputation beyond reputevinnie has a reputation beyond reputevinnie has a reputation beyond reputevinnie has a reputation beyond reputevinnie has a reputation beyond repute
Re: CPP to Java

A "low-tech" solution if you are running something like a Raspberry Pi on the robot you could just use a digital output connected to the digital sidecar and the cRIO could just read that.
__________________
Student (3309) 2010-2013
Mentor (597) 2014
Mentor (3309) 2013-Present
  #8   Spotlight this post!  
Unread 08-02-2014, 23:02
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: CPP to Java

Where is the CPP video processing program being run?

(And what is CPP video processing?)
  #9   Spotlight this post!  
Unread 09-02-2014, 17:40
E, Palmer E, Palmer is offline
Registered User
FRC #6239 (The Irrational Engineers)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2009
Location: Maryland
Posts: 15
E, Palmer will become famous soon enoughE, Palmer will become famous soon enough
Re: CPP to Java

Quote:
Originally Posted by Alan Anderson View Post
Where is the CPP video processing program being run?

(And what is CPP video processing?)

To answer your first question the CPP video processing is run on a raspberry pi.

To answer the second question CPP video processing is really opencv video processing.
  #10   Spotlight this post!  
Unread 09-02-2014, 21:46
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: CPP to Java

Quote:
Originally Posted by vinnie View Post
A "low-tech" solution if you are running something like a Raspberry Pi on the robot you could just use a digital output connected to the digital sidecar and the cRIO could just read that.
If all you really want is a yes/no signal, this sounds like a perfect way to satisfy the requirement.
Closed Thread


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 02:34.

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