Go to Post You know you are addicted to FIRST when you have trouble describing it because you realize it truly is way more than just a robotics competetion. - vivek16 [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 04-07-2014, 09:44 PM
The Doctor's Avatar
The Doctor The Doctor is offline
Robotics is life
AKA: Hackson
FRC #3216 (MR. T)
Team Role: Programmer
 
Join Date: Mar 2014
Rookie Year: 2013
Location: United States
Posts: 139
The Doctor is on a distinguished road
Create your own library, like WPILib?

I am writing a library, which contains all the stuff my team needs but isn't in WPILib, like integer mapping, threaded timers, and inverse kinematics for mecanum wheel drive. I would like to include it in the standard include directory, so i can simply do an
Code:
#include <MRTLib.h>
at the top of my C++ program and get my library. How do i do this?

I have already created a header and cpp file, which work already.
Reply With Quote
  #2   Spotlight this post!  
Unread 04-07-2014, 11:07 PM
The Doctor's Avatar
The Doctor The Doctor is offline
Robotics is life
AKA: Hackson
FRC #3216 (MR. T)
Team Role: Programmer
 
Join Date: Mar 2014
Rookie Year: 2013
Location: United States
Posts: 139
The Doctor is on a distinguished road
Re: Create your own library, like WPILib?

Might i have forgotten to mention that i am using Windriver C++?
Reply With Quote
  #3   Spotlight this post!  
Unread 04-09-2014, 12:48 PM
Sparkyshires Sparkyshires is offline
Registered User
AKA: Michael Shires
FRC #0384 (Sparky)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2006
Location: Virginia
Posts: 226
Sparkyshires is an unknown quantity at this point
Re: Create your own library, like WPILib?

I'd imagine it would be fairly simple to implement. Excellent idea by the way! We may try and accomplish the same thing.

Just copy the format of the WPILib. You would probably have to import all the files into every project you start, easiest way to do that I'd imagine would just have a folder titled MRTLib, and inside a file MRTLib.h, MRTLib.cpp, and all the other things you'd want to create. Just follow the format of the WPILib they did pretty well on it!

EDIT: on second thought, you could just add the classes you want into the WPILib! put the files in the WPILib location and add the include into the main WPILib.h file. would make your life a whole lot easier, although you'd have to re-import the classes every year.
__________________
"Measure with a micrometer, mark with chalk, cut with an axe."
Reply With Quote
  #4   Spotlight this post!  
Unread 04-09-2014, 12:56 PM
rich2202 rich2202 is offline
Registered User
FRC #2202 (BEAST Robotics)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Wisconsin
Posts: 1,117
rich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond repute
Re: Create your own library, like WPILib?

Note: Be careful about R13 (elements created before Kickoff) if you intend to reuse libraries from year to year. There is an exception for "publicly available prior to Kickoff". A post here with a link to your library should be sufficient for "publicly available".
Reply With Quote
  #5   Spotlight this post!  
Unread 04-10-2014, 06:28 PM
ekapalka's Avatar
ekapalka ekapalka is offline
Registered User
FRC #3216
 
Join Date: Dec 2012
Location: Bermuda
Posts: 277
ekapalka has a spectacular aura aboutekapalka has a spectacular aura about
Re: Create your own library, like WPILib?

psst... I can help you ;) All of my examples have been restricted to methods instead of separate classes and OOP because the vast majority of what I have been trying to teach you guys can be easily contained in a single file. I'll try to put up some examples when I get a chance...
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:16 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