Go to Post I think applying Gracious Professionalism to strictly legal game play trivializes what is a much more important and fundamental FIRST concept. - jimfortytwo [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 10-01-2010, 21:46
woodk woodk is offline
Registered User
FRC #2809
 
Join Date: Jan 2009
Location: Kingston, Ontario, Canada
Posts: 31
woodk has a spectacular aura aboutwoodk has a spectacular aura aboutwoodk has a spectacular aura about
Tips for C++ programming the 2010 control system

I had a little trouble getting the new WindRiver up and running so I thought I'd share a couple of things that I discovered or would recommend:

1. Make sure you install the updates:
- FRCLabVIEWUpdate2.0for2010.zip is needed even for C++
(from http://www.usfirst.org/roboticsprogr....aspx?id=10934)

- WorkbenchUpdate20100107.exe
(from http://first.wpi.edu/FRC/frccupdates.html)

- DSUpdate1.0for2010.zip
(also from http://www.usfirst.org/roboticsprogr....aspx?id=10934)

2. Follow the directions in "Getting started with C++" from http://first.wpi.edu/FRC/frccupdates.html

3. A couple of the examples didn't work:

CameraToDashboardExample and SimpleTracker needed:

- right-click on the project and select Properties
- select the "Build Paths" tab
- click "Add"
- enter: -I$(WIND_BASE)/target/h/WPILib/Vision2009

CameraToDashBoardExample needed:

- open "cameraToDashboardExample.cpp"
- add: #include "WPILib.h"

Hope that helps someone!
Reply With Quote
  #2   Spotlight this post!  
Unread 11-01-2010, 14:58
woodk woodk is offline
Registered User
FRC #2809
 
Join Date: Jan 2009
Location: Kingston, Ontario, Canada
Posts: 31
woodk has a spectacular aura aboutwoodk has a spectacular aura aboutwoodk has a spectacular aura about
Re: Tips for C++ programming the 2010 control system

Has anyone got the CameraToDashboardExample to actually work? I can compile it but I get nothing on the DriverStation. I notice that the driverstation program changes your IP address to 10.xx.yy.5 however the CameraToDashboardExample program says it is sending the images to 10.xx.yy.6 I tried setting up a remote dashboard with the IP10.xx.yy.6 but it is not able to connect to the robot at all.

Since there is no source code available yet, I can't change the code to send to 10.xx.yy.5.

Any I missing something, or should I just be patient and wait for a fix to be released?
Reply With Quote
  #3   Spotlight this post!  
Unread 11-01-2010, 15:25
jc4p jc4p is offline
Registered User
AKA: Kasra Rahjerdi
FRC #2412 (Robototes)
Team Role: Alumni
 
Join Date: Feb 2008
Rookie Year: 2008
Location: Bellevue
Posts: 12
jc4p is an unknown quantity at this point
Re: Tips for C++ programming the 2010 control system

Quote:
Originally Posted by woodk View Post
Has anyone got the CameraToDashboardExample to actually work? I can compile it but I get nothing on the DriverStation. I notice that the driverstation program changes your IP address to 10.xx.yy.5 however the CameraToDashboardExample program says it is sending the images to 10.xx.yy.6 I tried setting up a remote dashboard with the IP10.xx.yy.6 but it is not able to connect to the robot at all.

Since there is no source code available yet, I can't change the code to send to 10.xx.yy.5.

Any I missing something, or should I just be patient and wait for a fix to be released?
I could be wrong, but I think you just need to wait for the code to get updated and released. Last year, laptops attached to the dashboard would have the IP of 10.xx.yy.6, while the dashboard it self had 10.xx.yy.5. This year, because the dashboard and laptop are one item, the code needs to send its data to 10.xx.yy.5. Just wait until the new versions of the examples ship out and the updated verison of the CameraToDashboardExample sends to the correct IP.

Also, according to the 2010 WPLib Manual you should try using the 2010ImageDemo code sample.
Reply With Quote
  #4   Spotlight this post!  
Unread 11-01-2010, 15:51
jc4p jc4p is offline
Registered User
AKA: Kasra Rahjerdi
FRC #2412 (Robototes)
Team Role: Alumni
 
Join Date: Feb 2008
Rookie Year: 2008
Location: Bellevue
Posts: 12
jc4p is an unknown quantity at this point
Re: Tips for C++ programming the 2010 control system

Quote:
Originally Posted by woodk View Post
Has anyone got the CameraToDashboardExample to actually work? I can compile it but I get nothing on the DriverStation. I notice that the driverstation program changes your IP address to 10.xx.yy.5 however the CameraToDashboardExample program says it is sending the images to 10.xx.yy.6 I tried setting up a remote dashboard with the IP10.xx.yy.6 but it is not able to connect to the robot at all.

Since there is no source code available yet, I can't change the code to send to 10.xx.yy.5.

Any I missing something, or should I just be patient and wait for a fix to be released?
Also, I can't be 100% sure about this because I don't have access to our robot right now, but I think all you need to do to populate the video box in the dashboard program is insert this in your code:

Code:
AxisCamera &camera = AxisCamera::getInstance();
camera.writeResolution(k320x240);
camera.writeBrightness(0);
Of course, adjust resolution and brightness as necessary.

According to WPI_Library_Users_Guide.pdf found on:
http://first.wpi.edu/FRC/frccupdates.html

All you need to do to populate that field is to call the camera getInstance method somewhere in your code.
Reply With Quote
  #5   Spotlight this post!  
Unread 12-01-2010, 15:02
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Tips for C++ programming the 2010 control system

Nope, that does not do anything (for the dashboard image)
all you need to do is create a PCVideoServer object
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
Reply With Quote
  #6   Spotlight this post!  
Unread 14-01-2010, 16:31
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 592
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: Tips for C++ programming the 2010 control system

The code is automatically creating a PCVideo server instance when the camera is initialized. You should be able to see the images back at the dashboard if you have it running when the sample program starts running.

And if you have the newer dashboard with the targeting stuff, it should display the location of ellipses that were found. Green ones are the "acceptable" targets and magenta are the rest of the ellipses.

The 2010 Image demo should work, I just double checked it here. If it's still not working for you, I'll look around some more. I'm running with the dashboard and driver station on the same computer, both at the 10.x.y.6 IP address.
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
Reply With Quote
  #7   Spotlight this post!  
Unread 14-01-2010, 18:05
woodk woodk is offline
Registered User
FRC #2809
 
Join Date: Jan 2009
Location: Kingston, Ontario, Canada
Posts: 31
woodk has a spectacular aura aboutwoodk has a spectacular aura aboutwoodk has a spectacular aura about
Re: Tips for C++ programming the 2010 control system

I did finally get it working today. The biggest issue I had is that the DSupdate did not update the dashboard. I only noticed because I installed the update on a second laptop and it looked different. I went back and checked the file date and it was not the same on the classmate. I had to run the DSupdate program, but tell it to uninstall, then run it again and install. Now it works.

- Kevin
Reply With Quote
  #8   Spotlight this post!  
Unread 14-01-2010, 20:33
DanDon's Avatar
DanDon DanDon is offline
ohhh MY god
AKA: Dan Hoizner
FRC #0375 (The Robotic Plague)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Staten Island, NY
Posts: 1,432
DanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond repute
Send a message via ICQ to DanDon Send a message via AIM to DanDon Send a message via MSN to DanDon
Re: Tips for C++ programming the 2010 control system

Quote:
Originally Posted by BradAMiller View Post
The code is automatically creating a PCVideo server instance when the camera is initialized. You should be able to see the images back at the dashboard if you have it running when the sample program starts running.

And if you have the newer dashboard with the targeting stuff, it should display the location of ellipses that were found. Green ones are the "acceptable" targets and magenta are the rest of the ellipses.

The 2010 Image demo should work, I just double checked it here. If it's still not working for you, I'll look around some more. I'm running with the dashboard and driver station on the same computer, both at the 10.x.y.6 IP address.
Brad-

What should I have my classmate's IP address configured to?

I'm getting communications with the robot, and I have the camera tracking the target on a pan/tilt mount, but I'm not getting anything on the dashboard (nothing from the camera and nothing from the digital inputs/pwms either). The calls to DashboardDataSender are still there as per the 2010 Image demo.
__________________
Reply With Quote
  #9   Spotlight this post!  
Unread 15-01-2010, 10:44
woodk woodk is offline
Registered User
FRC #2809
 
Join Date: Jan 2009
Location: Kingston, Ontario, Canada
Posts: 31
woodk has a spectacular aura aboutwoodk has a spectacular aura aboutwoodk has a spectacular aura about
Re: Tips for C++ programming the 2010 control system

I think the classmate sets itself to 10.xx.yy.5 when you go into the Driver Station account. You should probably leave it that when even if you are using for development.

If you use a separate laptop for development, you can set it to 10.xx.yy.6

Make sure your dashboard is actually updated as per my previous message (right before yours). You should see a compass type angle readout in the bottom-right corner. If you don't have this then your Dashboard is not updated properly and you will have to uninstall it and then reinstall it using DSUpdate1.0for2010.zip

- Kevin

Last edited by woodk : 15-01-2010 at 10:47.
Reply With Quote
  #10   Spotlight this post!  
Unread 23-01-2010, 18:30
SuperBK's Avatar
SuperBK SuperBK is offline
Registered User
AKA: BrianK
FRC #1225 (Amperage Robotics)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Henersonville, NC
Posts: 358
SuperBK is just really niceSuperBK is just really niceSuperBK is just really niceSuperBK is just really nice
Re: Tips for C++ programming the 2010 control system

Under
C:\WindRiver\vxworks-6.3\target\h\WPIlib
I have a Vision and a Vision2009 folder
Should only Vision2009 be used this year?
__________________
Brian K
Team 1225 Robotics Mentor
Reply With Quote
  #11   Spotlight this post!  
Unread 23-01-2010, 19:19
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Tips for C++ programming the 2010 control system

Quote:
Originally Posted by SuperBK View Post
Under
C:\WindRiver\vxworks-6.3\target\h\WPIlib
I have a Vision and a Vision2009 folder
Should only Vision2009 be used this year?
The Vision dir is modern and what youd should use. The Vision2009 is the code from last year and is obsolete. Only there for old program compatibility.
Reply With Quote
  #12   Spotlight this post!  
Unread 23-01-2010, 19:27
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Tips for C++ programming the 2010 control system

Quote:
Originally Posted by DanDon View Post
What should I have my classmate's IP address configured to?
The classmate can always be 10.xx.yy.5

Quote:
Originally Posted by DanDon View Post
I'm getting communications with the robot, and I have the camera tracking the target on a pan/tilt mount, but I'm not getting anything on the dashboard (nothing from the camera and nothing from the digital inputs/pwms either). The calls to DashboardDataSender are still there as per the 2010 Image demo.
You are running it locally? Are you getting an error from the data unpacking on the dashboard? Perhaps your data types don't match.

Quote:
Originally Posted by woodk View Post
I think the classmate sets itself to 10.xx.yy.5 when you go into the Driver Station account. You should probably leave it that when even if you are using for development.

If you use a separate laptop for development, you can set it to 10.xx.yy.6
Correct.

Quote:
Originally Posted by jc4p View Post
I could be wrong, but I think you just need to wait for the code to get updated and released. Last year, laptops attached to the dashboard would have the IP of 10.xx.yy.6, while the dashboard it self had 10.xx.yy.5. This year, because the dashboard and laptop are one item, the code needs to send its data to 10.xx.yy.5. Just wait until the new versions of the examples ship out and the updated verison of the CameraToDashboardExample sends to the correct IP.
The robot is the server and the dashboard is the client. Therefore the IP address of the dashboard does not matter. It will connect to the robot to get images.

Quote:
Originally Posted by woodk View Post
Has anyone got the CameraToDashboardExample to actually work? I can compile it but I get nothing on the DriverStation. I notice that the driverstation program changes your IP address to 10.xx.yy.5 however the CameraToDashboardExample program says it is sending the images to 10.xx.yy.6 I tried setting up a remote dashboard with the IP10.xx.yy.6 but it is not able to connect to the robot at all.
Remote dashboard is only used if you are running the dashboard on a different laptop than the driver station application. If you choose local, the packets will be sent to localhost.

Quote:
Originally Posted by woodk View Post
Since there is no source code available yet, I can't change the code to send to 10.xx.yy.5.
There is source code available. What source are you waiting for? Look at http://firstforge.wpi.edu/sf/projects/wpilib
Reply With Quote
  #13   Spotlight this post!  
Unread 23-01-2010, 21:38
woodk woodk is offline
Registered User
FRC #2809
 
Join Date: Jan 2009
Location: Kingston, Ontario, Canada
Posts: 31
woodk has a spectacular aura aboutwoodk has a spectacular aura aboutwoodk has a spectacular aura about
Re: Tips for C++ programming the 2010 control system

Quote:
Originally Posted by jhersh View Post

There is source code available. What source are you waiting for? Look at http://firstforge.wpi.edu/sf/projects/wpilib
Yes, it is now. It was not when I posted.

The problem I had was that DSUpdate1.0for2010 did not in fact update the dashboard. It updated the driver station (the bottom window) but not the dashboard. I had to uninstall the old dashboard then reinstall the update for it to work. From several comments I have seen, I think many people have had this problem but not recognized it. Once the dashboard update installed properly the camera images appeared fine. The key thing to look for is if you have the gyro compass in the bottom-right corner of the dashboard. If you do not have this, then your update was not successful; you are still using the old version of the dashboard and you will not receive video.

- Kevin
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
2010 Control System Manual screamingeagle FRC Control System 9 11-01-2010 14:01
Unclaassified: Information about the 2010 control system Nadav Zingerman General Forum 35 24-11-2009 19:17
2009 Control System LabVIEW Tips and Pitfalls Travis Hoffman NI LabVIEW 3 22-12-2008 11:25
2009 Control System C++ Tips & Pitfalls heydowns Programming 1 19-12-2008 17:59
A few questions on programming the Control System Avarik Control System 21 08-02-2004 11:42


All times are GMT -5. The time now is 13:33.

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