Go to Post At this point (after shipping the robot), I'm really looking forward to doing laundry, eating a square meal, and getting to bed at a reasonable hour. - Emily Pease [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 Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 04-22-2012, 12:03 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: Multithreading and locking?

Quote:
Originally Posted by Ether View Post
Zera's Law: Once you realize that something bad can happen, it will.


I can attest to that. As soon as I took a second look at our code I realized that we'd had static initialization order issues, and sure enough, a few days later it segfaulted...

The AxisCamera code also has some locking that you can look at. We also wrapped it a little in our code: https://github.com/rbmj/612-code/blo...ion_thread.cpp
Reply With Quote
  #2   Spotlight this post!  
Unread 09-13-2012, 07:32 PM
jacob9706 jacob9706 is offline
Registered User
AKA: Jacob Ebey
FRC #3574 (High Tekerz)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Seattle
Posts: 101
jacob9706 is on a distinguished road
Re: Multithreading and locking?

Quote:
Originally Posted by rbmj View Post
I can attest to that. As soon as I took a second look at our code I realized that we'd had static initialization order issues, and sure enough, a few days later it segfaulted...

The AxisCamera code also has some locking that you can look at. We also wrapped it a little in our code: https://github.com/rbmj/612-code/blo...ion_thread.cpp
I was looking through your code and do you realize you can use namespaces?

so for example right after your includes you would put something like this...

using namespace cv;
using namespace std;


Now that you have that instead of doing something like

std::cout << cv:oint(10,10) << std::endl;

You can now do this

cout << Point(10,10) << endl;

Just something I thought I would share with everyone.
__________________
/*
* Team 3574 Alumni
*
* 2011 - Highest Seeded Rookie
* 2011 - Rookie All-Star
* 2012 - Engineering Inspiration
* 2012 - Olympic Deans List Winner
* 2013 - Engineering Inspiration
* 2013 - Judges Award (For unique circular robot and the way the team works together.)
*/
Reply With Quote
  #3   Spotlight this post!  
Unread 08-03-2015, 12:10 PM
knuckleduster knuckleduster is offline
Registered User
AKA: Jack Manning
FRC #0058 (The Riot Crew)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2007
Location: South Portland
Posts: 12
knuckleduster is an unknown quantity at this point
Re: Multithreading and locking?

Quote:
Originally Posted by jacob9706 View Post
I was looking through your code and do you realize you can use namespaces?

so for example right after your includes you would put something like this...

using namespace cv;
using namespace std;

Just something I thought I would share with everyone.
Actually, it isn't really considered good practice to use namespaces, when you start using multiple libraries with similarly named functions, it can get hectic, and its just better to get into the habit of not using them if possible.
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 10:49 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