Revision: 8653
http://playerstage.svn.sourceforge.net/playerstage/?rev=8653&view=rev
Author: thjc
Date: 2010-05-03 18:05:18 +0000 (Mon, 03 May 2010)
Log Message:
-----------
Applied patch 2950833: Player SVN trunk: epuck vs mricp
Modified Paths:
--------------
code/player/trunk/server/drivers/mixed/epuck/epuckPosition2d.hpp
code/player/trunk/server/drivers/mixed/epuck/timer.hpp
code/player/trunk/server/drivers/mixed/mricp/doc/html/Timer_8h-source.html
code/player/trunk/server/drivers/mixed/mricp/include/Timer.h
code/player/trunk/server/drivers/mixed/mricp/src/Timer.cpp
code/player/trunk/server/drivers/mixed/mricp/src/mricp_driver.cpp
Modified: code/player/trunk/server/drivers/mixed/epuck/epuckPosition2d.hpp
===================================================================
--- code/player/trunk/server/drivers/mixed/epuck/epuckPosition2d.hpp
2010-05-03 18:03:12 UTC (rev 8652)
+++ code/player/trunk/server/drivers/mixed/epuck/epuckPosition2d.hpp
2010-05-03 18:05:18 UTC (rev 8653)
@@ -104,7 +104,7 @@
private:
- Timer timer;
+ EpuckTimer timer;
// Holder for current position data estimated by e-puck robot odometry.
DynamicConfiguration odometryState;
@@ -128,3 +128,4 @@
};
#endif
+
Modified: code/player/trunk/server/drivers/mixed/epuck/timer.hpp
===================================================================
--- code/player/trunk/server/drivers/mixed/epuck/timer.hpp 2010-05-03
18:03:12 UTC (rev 8652)
+++ code/player/trunk/server/drivers/mixed/epuck/timer.hpp 2010-05-03
18:05:18 UTC (rev 8653)
@@ -20,7 +20,7 @@
#include <time.h>
/** \file
- * Header file of Timer class.
+ * Header file of EpuckTimer class.
*/
#define TIMEB timeb
@@ -32,11 +32,11 @@
* \author Renato Florentino Garcia
* \date August 2008
*/
-class Timer
+class EpuckTimer
{
public:
- Timer()
+ EpuckTimer()
:intervalRunning(false)
{}
@@ -115,3 +115,4 @@
#endif
+
Modified:
code/player/trunk/server/drivers/mixed/mricp/doc/html/Timer_8h-source.html
===================================================================
--- code/player/trunk/server/drivers/mixed/mricp/doc/html/Timer_8h-source.html
2010-05-03 18:03:12 UTC (rev 8652)
+++ code/player/trunk/server/drivers/mixed/mricp/doc/html/Timer_8h-source.html
2010-05-03 18:05:18 UTC (rev 8653)
@@ -16,16 +16,16 @@
<a name="l00002"></a>00002 <span class="preprocessor"></span><span
class="preprocessor">#define TIMER_H_</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span><span
class="preprocessor">#include <sys/time.h></span>
<a name="l00004"></a>00004 <span class="preprocessor">#include
<iostream></span>
-<a name="l00005"></a>00005 <span class="keyword">class </span>Timer
+<a name="l00005"></a>00005 <span class="keyword">class </span>MricpTimer
<a name="l00006"></a>00006 {
<a name="l00007"></a>00007 <span class="keyword">private</span>:
<a name="l00008"></a>00008 <span class="keyword">struct
</span>timeval start_time,end_time;
<a name="l00009"></a>00009 <span
class="keywordtype">double</span> time_diff;
<a name="l00010"></a>00010 <span class="keyword">public</span>:
-<a name="l00011"></a>00011 Timer();
+<a name="l00011"></a>00011 MricpTimer();
<a name="l00012"></a>00012 <span
class="keywordtype">double</span> TimeElapsed(); <span class="comment">// time
elapsed in usec since last call</span>
<a name="l00013"></a>00013 <span
class="keywordtype">void</span> Reset(); <span
class="comment">// resets timer</span>
-<a name="l00014"></a>00014 <span
class="keyword">virtual</span> ~Timer();
+<a name="l00014"></a>00014 <span
class="keyword">virtual</span> ~MricpTimer();
<a name="l00015"></a>00015 <span class="comment">/*
Synchronize the loop within a period</span>
<a name="l00016"></a>00016 <span class="comment"> * To use
this u will have to initialize the timer</span>
<a name="l00017"></a>00017 <span class="comment"> * reset the
timer at the beginning of the loop</span>
Modified: code/player/trunk/server/drivers/mixed/mricp/include/Timer.h
===================================================================
--- code/player/trunk/server/drivers/mixed/mricp/include/Timer.h
2010-05-03 18:03:12 UTC (rev 8652)
+++ code/player/trunk/server/drivers/mixed/mricp/include/Timer.h
2010-05-03 18:05:18 UTC (rev 8653)
@@ -22,16 +22,16 @@
#define TIMER_H_
#include <sys/time.h>
#include <iostream>
-class Timer
+class MricpTimer
{
private:
struct timeval start_time,end_time;
double time_diff;
public:
- Timer();
+ MricpTimer();
double TimeElapsed(); // time elapsed in usec since last call
void Reset(); // resets timer
- virtual ~Timer();
+ virtual ~MricpTimer();
/* Synchronize the loop within a period
* To use this u will have to initialize the timer
* reset the timer at the beginning of the loop
@@ -41,3 +41,4 @@
};
#endif /*TIMER_H_*/
+
Modified: code/player/trunk/server/drivers/mixed/mricp/src/Timer.cpp
===================================================================
--- code/player/trunk/server/drivers/mixed/mricp/src/Timer.cpp 2010-05-03
18:03:12 UTC (rev 8652)
+++ code/player/trunk/server/drivers/mixed/mricp/src/Timer.cpp 2010-05-03
18:05:18 UTC (rev 8653)
@@ -22,25 +22,25 @@
#include <ctime>
#include <cstddef>
-Timer::Timer()
+MricpTimer::MricpTimer()
{
gettimeofday(&start_time,NULL);
}
-double Timer::TimeElapsed() // return in usec
+double MricpTimer::TimeElapsed() // return in usec
{
gettimeofday(&end_time,NULL);
time_diff = ((double) end_time.tv_sec*1000000 +
(double)end_time.tv_usec) -
((double) start_time.tv_sec*1000000 +
(double)start_time.tv_usec);
return time_diff;
}
-Timer::~Timer()
+MricpTimer::~MricpTimer()
{
}
-void Timer::Reset()
+void MricpTimer::Reset()
{
gettimeofday(&start_time,NULL);
}
-void Timer::Synch(double period)
+void MricpTimer::Synch(double period)
{
struct timespec ts;
int us;
@@ -54,3 +54,4 @@
nanosleep(&ts, NULL);
}
}
+
Modified: code/player/trunk/server/drivers/mixed/mricp/src/mricp_driver.cpp
===================================================================
--- code/player/trunk/server/drivers/mixed/mricp/src/mricp_driver.cpp
2010-05-03 18:03:12 UTC (rev 8652)
+++ code/player/trunk/server/drivers/mixed/mricp/src/mricp_driver.cpp
2010-05-03 18:05:18 UTC (rev 8653)
@@ -324,7 +324,7 @@
global_diff,relative_pose,P;
vector<Point>
laser_set,laser_set_1,laser_set_2,local_map,occ_laser_set,map_points;
MAP *map;
- Timer delta_t_estimation;
+ MricpTimer delta_t_estimation;
};
Driver* MrIcp_Init(ConfigFile* cf, int section) // Create and return a new
instance of this driver
{
@@ -625,14 +625,14 @@
// this function will run in a separate thread
void MrIcp::Main()
{
- Timer loop_timer,map_timer,test;
+ MricpTimer loop_timer,map_timer,test;
double time_elapsed;
// Synchronously cancelable thread.
//pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED,NULL);
- /* To use the Timer.Synch() in a loop you will have to
+ /* To use the MricpTimer.Synch() in a loop you will have to
* reset the timer at the beginning of the loop then call
- * the Timer.Synch(period) at the end of the loop with
+ * the MricpTimer.Synch(period) at the end of the loop with
* period representing the synchronization time in msec,
* this method will check what is the total time spend in
* this loop and then sleep the remaining period time
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit