Go to Post Hard work is a necessary prerequisite for luck. - Ian Curtis [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 12-15-2011, 01:43 PM
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: C++ - No Code?

Quote:
Originally Posted by rbmj View Post
Got it to work - An update to version 30 of the firmware did the trick (I was using version 29).
Would you care to write up a document describing what you used and how you put it together (potentially including the Makefile you ended up with) so that others on Linux can get a head start?

Thanks,
-Joe
Reply With Quote
  #2   Spotlight this post!  
Unread 12-15-2011, 02:38 PM
AustinSchuh AustinSchuh is offline
Registered User
FRC #0971 (Spartan Robotics) #254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Feb 2005
Rookie Year: 1999
Location: Los Altos, CA
Posts: 800
AustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond repute
Re: C++ - No Code?

Quote:
Originally Posted by jhersh View Post
Would you care to write up a document describing what you used and how you put it together (potentially including the Makefile you ended up with) so that others on Linux can get a head start?

Thanks,
-Joe
The ucpp project is just that. It is nicely packaged to make it easy to use.

https://github.com/nikitakit/ucpp

Code:
Universal compiling scripts for FRC

System Requirements:
  For Linux: wine, wput
  For Windows: MSYSgit or Cygwin

Installation instructions:
 - Add the "ucpp/ucpp" folder to your system PATH
 - Run the ucpp setup script
       $ ucpp setup -t <team-number>

Creating a project
 $ ucpp init
        Configures the current directory as an FRC C++ project
        that deploys code to your team's robot.

        The ucpp build system aims to be fully compatible with
        development in WindRiver. You can initialize any existing
        WindRiver project as a ucpp project, as well as any folder
        that contains C++ files.

Building and deploying code
 $ ucpp configure
        Generates a Makefile for your project
        For additional options, run "ucpp configure help"
 $ make
        Compile the project
 $ make deploy
        Deploy code to the robot
Reply With Quote
  #3   Spotlight this post!  
Unread 12-15-2011, 03:03 PM
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: C++ - No Code?

Quote:
Originally Posted by AustinSchuh View Post
The ucpp project is just that. It is nicely packaged to make it easy to use.
Excellent. Somehow I had not seen this before. Nice work.

-Joe
Reply With Quote
  #4   Spotlight this post!  
Unread 12-16-2011, 01:51 PM
rbmj rbmj is offline
Registered User
FRC #0612 (Chantilly Robotics)
Team Role: Alumni
 
Join Date: Apr 2011
Rookie Year: 2011
Location: DC Area/Fairfax County
Posts: 192
rbmj is a jewel in the roughrbmj is a jewel in the roughrbmj is a jewel in the rough
Re: C++ - No Code?

Note that the main version by nikitakit doesn't work for me - it calls python2 which is only python on some boxes. Ozzloy added a few commits to detect where python2 was installed and call that through a shell variable, so his fork might work better for many users. He submitted a pull request a long time ago but upstream hasn't merged them in.

I made some patches to some of the scripts as well, as I was getting syntax errors on my computers (Debian & openSUSE). I have a fork at github (https://github.com/rbmj/ucpp) that has ozzloy's changes as well as mine until upstream merges them in. I've also requested that ozzloy merge my changes into his repo.

Last edited by rbmj : 12-16-2011 at 01:57 PM.
Reply With Quote
  #5   Spotlight this post!  
Unread 12-16-2011, 03:49 PM
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: C++ - No Code?

Quote:
Originally Posted by rbmj View Post
Note that the main version by nikitakit doesn't work for me - it calls python2 which is only python on some boxes. Ozzloy added a few commits to detect where python2 was installed and call that through a shell variable, so his fork might work better for many users. He submitted a pull request a long time ago but upstream hasn't merged them in.

I made some patches to some of the scripts as well, as I was getting syntax errors on my computers (Debian & openSUSE). I have a fork at github (https://github.com/rbmj/ucpp) that has ozzloy's changes as well as mine until upstream merges them in. I've also requested that ozzloy merge my changes into his repo.
Did not realize that, I though that was pulled a while ago. submit the pull request to nikitakit/ucpp (I just pulled ozzloy's)
__________________
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 12-16-2011, 05:36 PM
rbmj rbmj is offline
Registered User
FRC #0612 (Chantilly Robotics)
Team Role: Alumni
 
Join Date: Apr 2011
Rookie Year: 2011
Location: DC Area/Fairfax County
Posts: 192
rbmj is a jewel in the roughrbmj is a jewel in the roughrbmj is a jewel in the rough
Re: C++ - No Code?

Quote:
Originally Posted by byteit101 View Post
Did not realize that, I though that was pulled a while ago. submit the pull request to nikitakit/ucpp (I just pulled ozzloy's)
Since I forked from ozzloy, my pull request went to him.

The main issue was that the parsing of the team number into an ip address in ucpp-init. Since the method used in ucpp-setup worked, I changed ucpp-init to parse its arguments in the same manner. I also cleaned up the detect python function, as in my case it was outputting the found python twice. Also there was no need to use the output of that function to set ucpp_python_bin, as the variable is globally scoped. Last I included the found python in the settings file so it could be used from other scripts.
Reply With Quote
  #7   Spotlight this post!  
Unread 12-26-2011, 11:36 PM
runfrodorun runfrodorun is offline
Registered User
FRC #0111
 
Join Date: May 2011
Location: Schaumburg
Posts: 5
runfrodorun is an unknown quantity at this point
Re: C++ - No Code?

Hey: this may seem a bit off topic, but is there somewhere I could get information on compiling code targeting VxWorks on a ppc 603 cpu like you did without windriver? I'm running unix and I'm trying to figure out how to download code to out cRIO without a license for windriver.

I've started working on compiling my own cross tools to target the different CPU architecture, but I really don't know where to start. Any help appreciated!
Reply With Quote
  #8   Spotlight this post!  
Unread 12-27-2011, 12:35 AM
rbmj rbmj is offline
Registered User
FRC #0612 (Chantilly Robotics)
Team Role: Alumni
 
Join Date: Apr 2011
Rookie Year: 2011
Location: DC Area/Fairfax County
Posts: 192
rbmj is a jewel in the roughrbmj is a jewel in the roughrbmj is a jewel in the rough
Re: C++ - No Code?

Quote:
Originally Posted by runfrodorun View Post
Hey: this may seem a bit off topic, but is there somewhere I could get information on compiling code targeting VxWorks on a ppc 603 cpu like you did without windriver? I'm running unix and I'm trying to figure out how to download code to out cRIO without a license for windriver.
As stated earlier in the thread, the ucpp project is just that. You don't even have to compile the compiler - it downloads the windows binaries and runs them through wine. Yes, it's more difficult, but it's much easier than managing all of the configuration for the build of the new compiler. And if you're a windows person, you can either run ucpp through cygwin or download the gccdist provided by NI (https://decibel.ni.com/content/docs/DOC-14237) and run it yourself. Then you grab the latest version of WPILib from FIRSTForge, edit the sample makefile in the gccdist to suit your project, change the makefile to statically link in WPILib, and off you go.

Quote:
I've started working on compiling my own cross tools to target the different CPU architecture, but I really don't know where to start. Any help appreciated!
Again, if you want a native compiler, more power to you. But the easy way out is already there. Just a few scripts away. If you want more power (I myself wouldn't completely miss a compiler with c++0x support, but I don't want to have to worry about a non-standard toolchain screwing up things at competition) feel free to compile your own compiler, just remember that it is the harder way, you may get screwed by it, and few (er?) people will be able to help you.
Reply With Quote
  #9   Spotlight this post!  
Unread 12-27-2011, 03:10 AM
nikitakit nikitakit is offline
Registered User
FRC #0980 (Thunderbots)
 
Join Date: Feb 2009
Rookie Year: 2009
Location: California
Posts: 9
nikitakit will become famous soon enough
Re: C++ - No Code?

Hi rbmj. Thanks for the changes to ucpp - I've pulled them in.

Right now I'm in college, away from my team, so unfortunately that means I'm somewhat out of the loop on FRC and don't have a real robot to test code on. I'm probably not the best person to be maintaining ucpp at the moment.

That said, I'm still around online, and I'm still very much interested in seeing ucpp remain usable throughout the next competition. It's really a shame for teams not to be able to program on Linux when the tools are there, and have been there for quite a while.

byteit101 - do you plan to continue working on ucpp throughout the next year? It will need some updates after kick-off for everything to work with the new versions of WPILib, etc.
Reply With Quote
  #10   Spotlight this post!  
Unread 12-27-2011, 01:48 PM
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: C++ - No Code?

Quote:
Originally Posted by nikitakit View Post
byteit101 - do you plan to continue working on ucpp throughout the next year? It will need some updates after kick-off for everything to work with the new versions of WPILib, etc.
I do. I've been busy recently, but will probably work on it some more after kickoff.
__________________
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
  #11   Spotlight this post!  
Unread 12-27-2011, 02:53 AM
AustinSchuh AustinSchuh is offline
Registered User
FRC #0971 (Spartan Robotics) #254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Feb 2005
Rookie Year: 1999
Location: Los Altos, CA
Posts: 800
AustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond repute
Re: C++ - No Code?

Quote:
Originally Posted by runfrodorun View Post
I've started working on compiling my own cross tools to target the different CPU architecture, but I really don't know where to start. Any help appreciated!
I already got GCC 4.5.3 compiling on Linux and targeting the cRIO. My patches and build script are here. Thanks to Ross Light for cleaning it up and getting it to run on OSX. It is unsupported, but seems to work well. This also builds my own version of libstdc++v3 that seems to work on the cRIO. It would be nice to integrate this into ucpp at some point.

http://hg.zombiezen.com/vxworks-gcc-patches/overview
Reply With Quote
  #12   Spotlight this post!  
Unread 12-28-2011, 01:08 AM
rbmj rbmj is offline
Registered User
FRC #0612 (Chantilly Robotics)
Team Role: Alumni
 
Join Date: Apr 2011
Rookie Year: 2011
Location: DC Area/Fairfax County
Posts: 192
rbmj is a jewel in the roughrbmj is a jewel in the roughrbmj is a jewel in the rough
Re: C++ - No Code?

Quote:
Originally Posted by AustinSchuh View Post
I already got GCC 4.5.3 compiling on Linux and targeting the cRIO. My patches and build script are here. Thanks to Ross Light for cleaning it up and getting it to run on OSX. It is unsupported, but seems to work well. This also builds my own version of libstdc++v3 that seems to work on the cRIO. It would be nice to integrate this into ucpp at some point.

http://hg.zombiezen.com/vxworks-gcc-patches/overview
That's awesome that you have a newer version of GCC. I personally would *love* to be able to use some of the new features of C++11 (I've already gotten used to using them in my personal code, and it's kind of sad that I can't use them on FRC code), but I have reservations.

Primarily, I know that in order to pass inspection your robot must be running a certain version of the firmware. Now, I know that you could image the cRIO and then overwrite all of the libraries, but could you be disqualified for doing this? Anyone happen to know what the rules say on this? GCC 3 is so old... it seems like FIRST *should* encourage teams to innovate.

Also, at some point maybe I could modify ucpp to allow users to optionally install ucpp for their whole system. We could also look at integrating build scripts - if nothing else we could find the source for the same version of GCC that gccdist uses - this _in_theory_ should not have any issues and be fully compatible with the stock image.
Reply With Quote
  #13   Spotlight this post!  
Unread 12-28-2011, 04:24 AM
AustinSchuh AustinSchuh is offline
Registered User
FRC #0971 (Spartan Robotics) #254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Feb 2005
Rookie Year: 1999
Location: Los Altos, CA
Posts: 800
AustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond repute
Re: C++ - No Code?

It is fully legal. You are not replacing any librarys. You are only generating a binary that has a second version of the library symbols that have been re-named to avoid a namespace collision. There is no need to modify the firmware to get this to work. This is similar to writing your own printf and friends and using those.

If you want, it is also possible to use the old version of the standard libraries that comes with the cRIO and use the newer compiler with them. This will produce a number of warnings in the header files, but it will still work. This is the route that 971 went last year, since I hadn't gotten the symbol renaming worked out.
Reply With Quote
  #14   Spotlight this post!  
Unread 01-07-2012, 03:50 PM
nikitakit nikitakit is offline
Registered User
FRC #0980 (Thunderbots)
 
Join Date: Feb 2009
Rookie Year: 2009
Location: California
Posts: 9
nikitakit will become famous soon enough
Re: C++ - No Code?

I've updated ucpp-setup so that it pulls in 2012 WPILib. The default robot seems to compile fine. I have no idea what the Kinect libraries are all about though.
Reply With Quote
  #15   Spotlight this post!  
Unread 01-07-2012, 04:33 PM
newkidd-sagar newkidd-sagar is offline
Registered User
FRC #1241
 
Join Date: Jan 2010
Location: Mississauga
Posts: 13
newkidd-sagar is an unknown quantity at this point
Re: C++ - No Code?

Hey there, I was wondering if your team was able to get the FIRST menu option in the 2012 WindRiver Installation. Are there any WPILib updates online that I need to install? I also don't have any examples or templates like "SimpleRobot" etc.

Thanks for your help.
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:39 AM.

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