Diploma Thesis HSR
Development
I implemented the project together with my fellow students Josias Hosang and Oliver Kadlcek as our diploma thesis at HSR during the autumn semester 2006.
Detailed Description
Global navigation satellite systems (GNSS) like GPS are now widely known. Less known is that there are additionally networks of so called reference stations whose exact position is known. It is possible to compare these known exact positions and positions calculated by satellite observations from these stations. These comparisons can be used to create position correction data which can be used by professional mobile GNSS-receiver (so called rovers) to improve their position calculations. Reference stations and rovers produced by Leica Geosystems AG use different interfaces to exchange these data.
This diploma thesis targeted at creating a software component for a unified and transparent communication between the reference stations, rovers and computers connected to them. To decode the strings it used a modular library which allowed changing protocol format rapidly since the communication standard was not finished at the time of writing. Part of the diploma thesis was also the development of an application which collected all the different data and visualized the current position of all satellites orbiting earth and on the other hand visualizing the current position of the receiver connected to the application.
Technical Details
- Additional Developers: Josias Hosang, Oliver Kadlcek
- Programming Language: C++
- Development Environment: Microsoft Visual Studio.NET 2005
- Project Size: 117 files, 12'803 code lines, 3'638 comment lines, 4'432 blank lines, 364 KiB code
- Technology used: GNSS hardware
Feature List
- Communication with GNSS hardware
- Calculation of the exact position on earth using the data received
- Visualization of the position calculated
- Visualization of the navigation satellites orbiting earth
Screenshots
Challenges
In this project we faced to challenges:
As with every other project we had to test and debug the application. In addition we had to create a demonstration situation to present to the public during the diploma thesis exhibition. The difficulty there was that we had to use expensive equipment and that the satellite position only changes slowly. But to demonstrate the satellite position visualization we needed some sort of fast motion. In order to accomplish those two tasks we implemented an application to simulate the receiver-hardware. This emulation software was able to capture real data and replay it in different speeds to our main application. The idea was to use the equipment once to capture useful data and to use the simulator from then on. In the end we managed to implement it, but we had far more than one capture run.
The other challenge was that we had to use a lot of different receiving devices: Reference stations, rovers, the emulator mentioned above and others. These devices sent data asynchronously and in parallel. The challenge there was to get a multithreaded application up and running which was able to collect data from all those different sources and to combine it.
Code Sample
This code sample shows the main loop of the event centre that collects the different hardware events and queues them in order to be processed by the software.
//--------------------------------------------------------------------------------
void EventCenter::Run(
Thread* thread
)
{
if (thread != thread_)
{
throw Exception("invalid argument 'thread'");
}
abort_ = false;
while (!abort_)
{
newEventsSignal_->Wait();
{
MutexGuard guardLock(*guard_);
while (!newEvents_.empty())
{
Event* ev = newEvents_.front();
newEvents_.pop_front();
{
MutexGuard thisGuardLock(*this);
events_.push_back(ev);
switch (sortMethode_)
{
case EventSortBySourceTime:
SortEventsBySourceTime();
break;
case EventSortByReceivedTime:
SortEventsByReceivedTime();
break;
}
}
// Watch event queue size, delete excess events.
if( events_.size() > maxEvents_ )
{
Event* eventToRemove = events_.front();
events_.pop_front();
guard_->Unlock();
try
{
FireEventRemoved( eventToRemove );
delete eventToRemove;
}
catch (...)
{
guard_->Lock();
throw;
}
guard_->Lock();
}
// needs to unlock the guard_ since the eventlistener
// are able to change things on this server. which would
// lead into a deadlock because of recursive mutex-locks.
guard_->Unlock();
try
{
FireEventAdded(ev);
}
catch (...)
{
guard_->Lock();
throw;
}
// lock it again
guard_->Lock();
}
}
}
}