Go to Post Team Titanium's trying Teeter Totter Talons tying the terrain traversal tandoming Twin Tucking Tabs to try triples. - [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 23-03-2012, 21:23
theNerd's Avatar
theNerd theNerd is offline
Registered User
FRC #3329 (Cam Bots)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2110
Location: St. Marys
Posts: 51
theNerd is an unknown quantity at this point
A work around for Linux users

I understand that Netbeans is available for Linux - and that it works swell for the robot programming. However, after learning that one can simply FTP files to the cRIO - which is what Netbeans does if I remember correctly - would it be possible to do the whole 9 yards through terminal? What I mean is:

1. writing the source code through VIM or another text editor

2. compiling the code (I'm not sure how far this can go due to my lack in knowledge with the WPILIB API releases and what Netbeans does exactly when it compiles the source code and creates the images)

3. FTP'ing the code to the cRIO.

If anyone could help explain the dirty details of what goes on in 2 and 3 I would be much obliged. Thanks awesome robotics community!
  #2   Spotlight this post!  
Unread 24-03-2012, 16:57
Scimor5 Scimor5 is offline
Registered User
AKA: Brett
FRC #4520 (Misfit Toys)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Post Falls
Posts: 11
Scimor5 is an unknown quantity at this point
Re: A work around for Linux users

compiling in a terminal is really easy. for c++ programs using g++ and its arguments correctly takes care of everything.

Code:
g++ -o myProgram thing.cpp main.cpp
This command compiles and links the code files
"thing.cpp" and "main.cpp" together into the executable program called
"myProgram".

other things to worry about are libraries

-I : Sets the path to the include files.
-L : Sets the path to the libraries.
-l : Use this library (eg. -lm to use libmath.so, -lpthread to use libpthread.so)

You can have multiple -I, -L and -l entries.
So, your final command should look like this:
Code:
g++ -o myProgram thing.cpp main.cpp -I /path/to/includes -L /path/to/libraries -l library1 -l library2
info about libraries can be found with the pkgconfig command.
__________________
Good luck from team 4520
  #3   Spotlight this post!  
Unread 25-03-2012, 20:16
theNerd's Avatar
theNerd theNerd is offline
Registered User
FRC #3329 (Cam Bots)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2110
Location: St. Marys
Posts: 51
theNerd is an unknown quantity at this point
Talking Re: A work around for Linux users

Quote:
Originally Posted by Scimor5 View Post
compiling in a terminal is really easy. for c++ programs using g++ and its arguments correctly takes care of everything.

Code:
g++ -o myProgram thing.cpp main.cpp
This command compiles and links the code files
"thing.cpp" and "main.cpp" together into the executable program called
"myProgram".

other things to worry about are libraries

-I : Sets the path to the include files.
-L : Sets the path to the libraries.
-l : Use this library (eg. -lm to use libmath.so, -lpthread to use libpthread.so)

You can have multiple -I, -L and -l entries.
So, your final command should look like this:
Code:
g++ -o myProgram thing.cpp main.cpp -I /path/to/includes -L /path/to/libraries -l library1 -l library2
info about libraries can be found with the pkgconfig command.
Haha! You have no idea how happy I am to have found a c++ person who knows about libraries . I used to be a Java programmer - still am - but now I would like to make c++ my core language seen that I'm going to need it a ton in college. Could you send me links to resources that greatly aided you in learning c++? and could I private message you with questions as I go through my learning curve?
  #4   Spotlight this post!  
Unread 25-03-2012, 23:09
Scimor5 Scimor5 is offline
Registered User
AKA: Brett
FRC #4520 (Misfit Toys)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Post Falls
Posts: 11
Scimor5 is an unknown quantity at this point
Re: A work around for Linux users

Quote:
Originally Posted by theNerd View Post
Haha! You have no idea how happy I am to have found a c++ person who knows about libraries . I used to be a Java programmer - still am - but now I would like to make c++ my core language seen that I'm going to need it a ton in college. Could you send me links to resources that greatly aided you in learning c++? and could I private message you with questions as I go through my learning curve?
sure you can PM me all you like. for the most part i learned by googling what i needed at the time. Lots of trial and error. the only specific resource i recommend is this http://www.amazon.com/C-Pocket-Refer...2730753&sr=8-3 it's purely an outline of every command and bit of syntax, no tutorials. its for when you remember your supposed to use something, but don't remember how to use it, or you know this command exists in java, and want to see how to use the c++ equivalent. c++ isn't very hard to learn especially if your coming from a different programming language.
__________________
Good luck from team 4520
  #5   Spotlight this post!  
Unread 26-03-2012, 00:21
Kevin Wang's Avatar
Kevin Wang Kevin Wang is offline
Software Engineer, Webmaster
FRC #0694 (StuyPulse)
Team Role: Alumni
 
Join Date: Jun 2010
Rookie Year: 2010
Location: New York
Posts: 28
Kevin Wang is an unknown quantity at this point
Re: A work around for Linux users

I put this together quickly to see what a terminal-based FRC IDE would look like. It's Vim and ant in tmux.

http://i42.tinypic.com/wjfa7b.png

Vim is running NERDtree on the left and the bottom window is zsh running 'ant deploy'.
__________________
  #6   Spotlight this post!  
Unread 28-03-2012, 19:33
theNerd's Avatar
theNerd theNerd is offline
Registered User
FRC #3329 (Cam Bots)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2110
Location: St. Marys
Posts: 51
theNerd is an unknown quantity at this point
Re: A work around for Linux users

Wow! I like it! Would you guys happen to know where the wpilib is installed on a unix based system? ..... specifically Ubuntu
  #7   Spotlight this post!  
Unread 28-03-2012, 21:52
alberth alberth is offline
Programmer and Engineer
FRC #4067 (The Incredible Hawk)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2011
Location: Maryland
Posts: 9
alberth is an unknown quantity at this point
Re: A work around for Linux users

The biggest hurdle for Linux users is the FRC Driver Station. Sure, you can definitely program on any OS, but to control the robot itself... I faintly recall someone working on a portable, Python version of the driver station (barebones).

As for IDE, I'm still a GUI fan (I have an interesting aversion to vim). Nevertheless, I like my IDEs light - I use Geany for the majority of my code editing. (For Windows users, this is an amazing counterpart to Notepad++!)

I'm not sure how C/C++ can be compiled on Linux, simply because what you compile might not be compatible with the cRIO. When you compile something, you are usually compiling it for the current system. Most compilers compile for x86, which I'm 99% sure isn't the cRIO's processor!

If you want to, you can find the cRIO's processor target, and then build the GCC cross compiler for that particular processor target. (I have a few BASH scripts to do that - if you're interested in attempting this, free free to ask) Even then, you will also need the FRC specific headers to make things work.

It's hard, but it's possible!

EDIT: Based on the screenshot found here (my team programs in Java, not C/C++), it looks like the processor is a MPC5200 processor or similar. (This one is based on a PowerPC CPU core.) Happy hacking!
__________________
Team #4067 - The Incredible Hawk
Role: Lead Programmer
Team Website

2012 Rookie Inspiration Award (Chesapeake Regional)

"You can't warm up by standing still in the frigid cold. Get moving!"

Last edited by alberth : 28-03-2012 at 21:57.
  #8   Spotlight this post!  
Unread 28-03-2012, 22:41
andreboos andreboos is offline
Registered User
FRC #3021 (The Agency)
Team Role: Programmer
 
Join Date: Dec 2009
Rookie Year: 2010
Location: San Diego
Posts: 132
andreboos is a jewel in the roughandreboos is a jewel in the roughandreboos is a jewel in the roughandreboos is a jewel in the rough
Re: A work around for Linux users

I'm surprised nobody has brought this up yet: UCPP by nikitakit is a decent way to build on Linux or Mac.

Last year I used a custom makefile to compile C++ code for the robot, but it was incompatible with this year's version of WPILib, so I switched to UCPP. Now I can program, compile, and deploy from emacs.
  #9   Spotlight this post!  
Unread 28-03-2012, 23:37
StevenB StevenB is offline
is having FRC withdrawal symptoms.
AKA: Steven Bell
no team
Team Role: College Student
 
Join Date: May 2005
Rookie Year: 2005
Location: Stanford, CA
Posts: 416
StevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond repute
Re: A work around for Linux users

Quote:
Originally Posted by theNerd View Post
Wow! I like it! Would you guys happen to know where the wpilib is installed on a unix based system? ..... specifically Ubuntu
I don't have Netbeans installed right now, but my best guess is ~/.netbeans/plugins or something like that. You don't need root to install the plugin, so it's got to be somewhere in your home directory. If you just need the files, you can download them from FIRSTForge and unzip the archive yourself.

PS, locate is your friend.
__________________
Need a physics refresher? Want to know if that motor is big enough for your arm? A FIRST Encounter with Physics

2005-2007: Student | Team #1519, Mechanical Mayhem | Milford, NH
2008-2011: Mentor | Team #2359, RoboLobos | Edmond, OK
2014-??: Mentor | Looking for a team...
  #10   Spotlight this post!  
Unread 03-04-2012, 21:46
Kevin Wang's Avatar
Kevin Wang Kevin Wang is offline
Software Engineer, Webmaster
FRC #0694 (StuyPulse)
Team Role: Alumni
 
Join Date: Jun 2010
Rookie Year: 2010
Location: New York
Posts: 28
Kevin Wang is an unknown quantity at this point
Re: A work around for Linux users

Quote:
Originally Posted by theNerd View Post
Wow! I like it! Would you guys happen to know where the wpilib is installed on a unix based system? ..... specifically Ubuntu
I believe it's somewhere in ~/sunspotfrcsdk.
__________________
  #11   Spotlight this post!  
Unread 06-04-2012, 00:36
Slix Slix is offline
Registered User
AKA: Peter Kowalczyk
FRC #2115 (NightMares)
Team Role: Programmer
 
Join Date: Mar 2010
Rookie Year: 2010
Location: Mundelein, IL
Posts: 31
Slix is an unknown quantity at this point
Re: A work around for Linux users

It'd be nice to be able to do all FRC programming tasks in Linux. Unfortunately, the LabVIEW-based Driver's Station, cRio Imaging Tool, and others make that difficult.

I know someone was working on a Driver's Station without these restrictions. What about the others? Could the imaging tool's functionality be reimplemented in some cross-platform way?
  #12   Spotlight this post!  
Unread 14-04-2012, 06:45
techhelpbb's Avatar
techhelpbb techhelpbb is offline
Registered User
FRC #0011 (MORT - Team 11)
Team Role: Mentor
 
Join Date: Nov 2010
Rookie Year: 1997
Location: New Jersey
Posts: 1,624
techhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond repute
Re: A work around for Linux users

Quote:
Originally Posted by Slix View Post
It'd be nice to be able to do all FRC programming tasks in Linux. Unfortunately, the LabVIEW-based Driver's Station, cRio Imaging Tool, and others make that difficult.

I know someone was working on a Driver's Station without these restrictions. What about the others? Could the imaging tool's functionality be reimplemented in some cross-platform way?
For just the build environment you could create a build environment in Windows you RDP to and drop your source on through a network share.

All you need is a real license of Windows XP Professional, if you use XP Home you can use VNC.

You could also put the whole thing in a VMWare, Xen or KVM virtual machine and then don't even need more harware (haven't tried this in a while but it should work).

I know my team does most of it's development in Eclipse with Java on Linux and Mac OSX. They tried to port the driver's station with some success. However, even if you create that code I'm not convinced it's entirely legal for competition use without specific approval.

Last edited by techhelpbb : 14-04-2012 at 08:44.
  #13   Spotlight this post!  
Unread 14-04-2012, 02:07
Earnesterin Earnesterin is offline
Junior Member
no team
 
Join Date: Mar 2012
Location: new york
Posts: 2
Earnesterin is an unknown quantity at this point
Re: A work around for Linux users

Earlier this week, we reported how the Free Agent range had difficulty using the Linux operating system due to the power management system.
A Seagate diskspinner called Nathan Papadopulos said that all Seagate and Maxtor branded external storage drives feature a power management that places the drive into a sleep mode after 15 minutes of inactivity.
  #14   Spotlight this post!  
Unread 14-04-2012, 06:37
techhelpbb's Avatar
techhelpbb techhelpbb is offline
Registered User
FRC #0011 (MORT - Team 11)
Team Role: Mentor
 
Join Date: Nov 2010
Rookie Year: 1997
Location: New Jersey
Posts: 1,624
techhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond repute
Re: A work around for Linux users

Quote:
Originally Posted by Earnesterin View Post
Earlier this week, we reported how the Free Agent range had difficulty using the Linux operating system due to the power management system.
A Seagate diskspinner called Nathan Papadopulos said that all Seagate and Maxtor branded external storage drives feature a power management that places the drive into a sleep mode after 15 minutes of inactivity.
With the Seagate utilities you can change the relevant settings.

Otherwise Vixie cron up a job to write or touch a file on the mounted volume.

You can also change the threshold of the write cache to flush more frequently or less frequently (in Linux you can delay the writes for 24 hours I do it all the time, just remember if you don't flush before you loose power your data is gone). Flush more frequently you keep your data and keep the drive awake (especially if you use a journaling partition). Flush less frequently you don't care if the drive sleeps, but you might loose your data.

Also, the problem is not confined to Linux. The power management on the Seagate Free Agents is especially aggressive and can shorten the drive life even in Windows. I'd recommened tinkering with it if you leave the drive connected for long periods of time.

If you need more assistance on how to do this please let me know.

Last edited by techhelpbb : 14-04-2012 at 06:46.
  #15   Spotlight this post!  
Unread 24-03-2012, 18:25
frasnow's Avatar
frasnow frasnow is offline
Software
no team
Team Role: Alumni
 
Join Date: Jun 2010
Rookie Year: 2010
Location: PNW
Posts: 84
frasnow is a name known to allfrasnow is a name known to allfrasnow is a name known to allfrasnow is a name known to allfrasnow is a name known to allfrasnow is a name known to all
Re: A work around for Linux users

Quote:
Originally Posted by theNerd View Post
would it be possible to do the whole 9 yards through terminal?
Sure it's possible, but why give up powerful tools like autocomplete, visible javadoc, Go to Source, tabs of code, quick access to the FIRST libraries, etc.? Some old time programmers consider those a crutch, but they're actually just wasting time doing things the slow way. Yes, I know some people think the command line makes you look cool, and it's probably a good learning exercise to make this happen. I still ask, why?
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 01:40.

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