Skip to content

Commit

Permalink
GN3S now incorporated into the receiver. Use -gn3s flag to invoke. Mu…
Browse files Browse the repository at this point in the history
…st use the ./install_gn3s.sh script in /usrp to modify udev. Updated GUI a little bit. GUI will now log a .klm file and a Rinex observation file. Also changed USRP code to use the variable gain in the BDS-RX for automatic gain contol.
  • Loading branch information
gpssim committed Jul 24, 2009
1 parent 6153c01 commit 42f8461
Show file tree
Hide file tree
Showing 34 changed files with 3,952 additions and 1,557 deletions.
6 changes: 5 additions & 1 deletion Makefile
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ VPATH = accessories: \
usrp:

LDFLAGS = -lpthread -lusrp -m32
CFLAGS = -O2 -D_FORTIFY_SOURCE=0 -g3 $(CINCPATHFLAGS)
CFLAGS = -O2 -D_FORTIFY_SOURCE=0 -g3 -m32 $(CINCPATHFLAGS)
ASMFLAGS = -masm=intel

SKIP = %main.cpp %simd-test.cpp %fft-test.cpp %acq-test.cpp %sse_new.cpp %gps-usrp.cpp
SRCC = $(wildcard main/*.cpp simd/*.cpp accessories/*.cpp acquisition/*.cpp objects/*.cpp usrp/*.cpp)
SRC = $(filter-out $(SKIP), $(SRCC))
OBJS = $(SRC:.cpp=.o)
OBJS += usrp/gn3s_firmware.o
HEADERS = $(wildcard accessories/*.h acquisition/*.h main/*.h objects/*.h simd/*.h includes/*.h)

#Uncomment these to look at the disassembly
Expand Down Expand Up @@ -60,6 +61,9 @@ simd-test: simd-test.o $(OBJS)
%.o:%.s
$(ASM) $(CFLAGS) -c $< -o $@

%.o:%.ihx
ld -r -b binary $< -o $@

gps-gse:
make --directory=./gse

Expand Down
7 changes: 4 additions & 3 deletions accessories/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,15 +269,16 @@ int32 run_agc(CPX *_buff, int32 _samps, int32 bits, int32 scale)

/* Get rid of the divide, replace with a multiply to scale to 2^15, then right shift to get
* back into AGC_BITS of magnitude */
lscale = (1 << 14) / scale;
shift = 14 - bits;
// lscale = (1 << 14) / scale;
// shift = 14 - bits;
max = 1 << bits;
num = 0;

x86_muls((int16 *)_buff, &lscale, 2*_samps, shift);
// x86_muls((int16 *)_buff, &lscale, 2*_samps, shift);

for(lcv = 0; lcv < 2*_samps; lcv++)
{
p[lcv] >>= 7;
if(abs(p[lcv]) > max)
num++;
}
Expand Down
2,640 changes: 1,465 additions & 1,175 deletions gse/gui.fbp

Large diffs are not rendered by default.

229 changes: 114 additions & 115 deletions gse/gui_classes.cpp

Large diffs are not rendered by default.

60 changes: 32 additions & 28 deletions gse/gui_classes.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,68 +115,69 @@ class iGUI_PVT : public wxFrame
wxPanel* pCN0;
wxStaticText* m_staticText5311;
wxStaticText* m_staticText5343;
wxStaticText* rticks;
wxTextCtrl* rticks;
wxStaticText* m_staticText536111;
wxStaticText* sticks;
wxTextCtrl* sticks;
wxStaticText* m_staticText53411;
wxStaticText* cticks;
wxTextCtrl* cticks;
wxStaticText* m_staticText5321;

wxStaticText* m_staticText53511;
wxStaticText* iter;
wxTextCtrl* iter;
wxStaticText* m_staticText53431;
wxStaticText* nsv;
wxTextCtrl* nsv;
wxStaticText* m_staticText531;
wxStaticText* m_staticText534;
wxStaticText* lat;
wxTextCtrl* lat;
wxStaticText* m_staticText5341;
wxStaticText* lon;
wxTextCtrl* lon;
wxStaticText* m_staticText53611;
wxStaticText* alt;
wxTextCtrl* alt;
wxStaticText* m_staticText53614;
wxStaticText* gdop;
wxTextCtrl* gdop;
wxStaticText* m_staticText532;
wxStaticText* m_staticText535;
wxStaticText* px;
wxTextCtrl* px;
wxStaticText* m_staticText5351;
wxStaticText* py;
wxTextCtrl* py;
wxStaticText* m_staticText53612;
wxStaticText* pz;
wxTextCtrl* pz;

wxStaticText* m_staticText533;
wxStaticText* m_staticText536;
wxStaticText* vx;
wxTextCtrl* vx;
wxStaticText* m_staticText5361;
wxStaticText* vy;
wxTextCtrl* vy;
wxStaticText* m_staticText53613;
wxStaticText* vz;
wxTextCtrl* vz;
wxStaticText* m_staticText5342;
wxStaticText* speed;
wxTextCtrl* speed;
wxStaticText* m_staticText57721;
wxStaticText* utct;
wxTextCtrl* utct;
wxStaticText* m_staticText577;
wxStaticText* gpsw;
wxTextCtrl* gpsw;
wxStaticText* m_staticText5772;
wxStaticText* gpss;
wxTextCtrl* gpss;
wxStaticText* m_staticText5771;
wxStaticText* cb;
wxTextCtrl* cb;
wxStaticText* m_staticText57711;
wxStaticText* cr;
wxTextCtrl* cr;
wxStaticText* m_staticText5773;
wxStaticText* ppsstate;
wxTextCtrl* ppsstate;
wxStaticText* m_staticText577211;
wxStaticText* ppscmd;
wxTextCtrl* ppscmd;
wxStaticText* m_staticText57712;
wxStaticText* ppscr;
wxTextCtrl* ppscr;
wxStaticText* m_staticText577111;
wxStaticText* ppserr;
wxTextCtrl* ppserr;


// Virtual event handlers, overide them in your derived class
virtual void OnClose( wxCloseEvent& event ){ event.Skip(); }


public:
iGUI_PVT( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("PVT"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 1000,600 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL );
iGUI_PVT( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("PVT"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 1600,600 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL );
~iGUI_PVT();

};
Expand Down Expand Up @@ -495,6 +496,7 @@ class iGUI_Log : public wxDialog
wxButton* bOK;

public:
wxDirPickerCtrl* mFile;
wxCheckBox* cPVT;
wxCheckBox* cClock;
wxCheckBox* cPPS;
Expand All @@ -506,8 +508,10 @@ class iGUI_Log : public wxDialog
wxCheckBox* cTask;
wxCheckBox* cBoard;
wxCheckBox* cSVPred;
wxFilePickerCtrl* mFile;
iGUI_Log( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Logging Config"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE );
wxCheckBox* cGearth;
wxCheckBox* cRobs;
wxCheckBox* cRephem;
iGUI_Log( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Logging Config"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 600,400 ), long style = wxDEFAULT_DIALOG_STYLE );
~iGUI_Log();

};
Expand Down
20 changes: 16 additions & 4 deletions gse/include/gui_serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class GUI_Serial : public Threaded_Object
/* Headers for CCSDC packets */
CCSDS_Packet_Header packet_header; //!< CCSDS Packet header
CCSDS_Decoded_Header decoded_packet; //!< Decoded header
int32 packet_count[LAST_M_ID+1]; //!< Count the packets
int32 packet_count[LAST_M_ID + 1]; //!< Count the packets
int32 byte_count; //!< Count the bytes

/* Buffer for commands */
Expand All @@ -75,9 +75,13 @@ class GUI_Serial : public Threaded_Object

/* Logging variables */
int32 logging_on; //!< Control overall logging
char filename[1024]; //!< Log to this file
char filepath[1024]; //!< Log to this path
FILE *robsfile; //!< Pointer to Rinex observation file
FILE *rephemfile; //!< Pointer to Rinex ephemeris file
FILE *lfile; //!< Pointer to log file
int32 log_flag[LAST_M_ID]; //!< Control messages on/off
FILE *gfile; //!< Pointer to google earth file
int32 gfile_end; //!< Pointer to end of gfile
int32 log_flag[LAST_M_ID + 20]; //!< Control messages on/off

public:

Expand Down Expand Up @@ -115,7 +119,7 @@ class GUI_Serial : public Threaded_Object
void logStop();
void logClear();
void setLogFile(const char *_str);
char *getLogFile(){return(&filename[0]);};
char *getLogFile(){return(&filepath[0]);};

void printPVT();
void printClock();
Expand All @@ -130,6 +134,14 @@ class GUI_Serial : public Threaded_Object
void printSVPred(int32 _sv);
void printTask();
void printBoard();
void printGoogleEarth();
void printGoogleEarthHeader();
void printGoogleEarthFooter();
void printRinexObs();
void printRinexObsHeader();
void printRinexEphem();
void printRinexEphemHeader();

void pendCommand(); //!< Wait for a free command
int32 peekCommand(); //!< Poll for a command

Expand Down
73 changes: 39 additions & 34 deletions gse/src/gui_pvt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,58 +187,63 @@ void GUI_PVT::renderPVT()

vel = sqrt(pNav->vz*pNav->vz + pNav->vy*pNav->vy + pNav->vx*pNav->vx);

str.Printf(wxT("%15d"),pNav->tic); rticks->SetLabel(str);
str.Printf(wxT("%15d"),pNav->converged_ticks); cticks->SetLabel(str);
str.Printf(wxT("%15d"),pNav->stale_ticks); sticks->SetLabel(str);
str.Printf(wxT("%15d"),nchan); nsv->SetLabel(str);
str.Printf(wxT("%15.2f m"),pNav->x); px->SetLabel(str);
str.Printf(wxT("%15.2f m"),pNav->y); py->SetLabel(str);
str.Printf(wxT("%15.2f m"),pNav->z); pz->SetLabel(str);
str.Printf(wxT("%.2f cm/s"),100.0*pNav->vx); vx->SetLabel(str);
str.Printf(wxT("%.2f cm/s"),100.0*pNav->vy); vy->SetLabel(str);
str.Printf(wxT("%.2f cm/s"),100.0*pNav->vz); vz->SetLabel(str);
str.Printf(wxT("%.2f m/s"),vel); speed->SetLabel(str);

str.Printf(wxT("%15.9f"),pNav->latitude*RAD_2_DEG); lat->SetLabel(str);
str.Printf(wxT("%15.9f"),pNav->longitude*RAD_2_DEG); lon->SetLabel(str);
str.Printf(wxT("%15.2f"),pNav->altitude); alt->SetLabel(str);

str.Printf(wxT("%15.9f"),pClock->bias); cb->SetLabel(str);
str.Printf(wxT("%15.6f"),pClock->rate); cr->SetLabel(str);
str.Printf(wxT("%15.6f"),pClock->time); gpss->SetLabel(str);
str.Printf(wxT("%8u"),pClock->week); gpsw->SetLabel(str);
str.Printf(wxT("%8u"),pNav->iterations); iter->SetLabel(str);
str.Printf(wxT("%15.2f"),pNav->gdop); gdop->SetLabel(str);
str.Printf(wxT("%15e"),pPPS->err_lp); ppserr->SetLabel(str);
str.Printf(wxT("%15e"),pPPS->feedback*SPEED_OF_LIGHT); ppscmd->SetLabel(str);
str.Printf(wxT("%15e"),pPPS->clock_rate*SPEED_OF_LIGHT);ppscr->SetLabel(str);
str.Printf(wxT("%15d"),pNav->tic); rticks->Clear(); rticks->WriteText(str);
str.Printf(wxT("%15d"),pNav->converged_ticks); cticks->Clear(); cticks->WriteText(str);
str.Printf(wxT("%15d"),pNav->stale_ticks); sticks->Clear(); sticks->WriteText(str);
str.Printf(wxT("%15d"),nchan); nsv->Clear(); nsv->WriteText(str);
str.Printf(wxT("%15.2f m"),pNav->x); px->Clear(); px->WriteText(str);
str.Printf(wxT("%15.2f m"),pNav->y); py->Clear(); py->WriteText(str);
str.Printf(wxT("%15.2f m"),pNav->z); pz->Clear(); pz->WriteText(str);
str.Printf(wxT("%.2f cm/s"),100.0*pNav->vx); vx->Clear(); vx->WriteText(str);
str.Printf(wxT("%.2f cm/s"),100.0*pNav->vy); vy->Clear(); vy->WriteText(str);
str.Printf(wxT("%.2f cm/s"),100.0*pNav->vz); vz->Clear(); vz->WriteText(str);
str.Printf(wxT("%.2f m/s"),vel); speed->Clear(); speed->WriteText(str);

str.Printf(wxT("%15.9f"),pNav->latitude*RAD_2_DEG); lat->Clear(); lat->WriteText(str);
str.Printf(wxT("%15.9f"),pNav->longitude*RAD_2_DEG); lon->Clear(); lon->WriteText(str);
str.Printf(wxT("%15.2f"),pNav->altitude); alt->Clear(); alt->WriteText(str);

str.Printf(wxT("%15.9f"),pClock->bias); cb->Clear(); cb->WriteText(str);
str.Printf(wxT("%15.6f"),pClock->rate); cr->Clear(); cr->WriteText(str);
str.Printf(wxT("%15.6f"),pClock->time); gpss->Clear(); gpss->WriteText(str);
str.Printf(wxT("%8u"),pClock->week); gpsw->Clear(); gpsw->WriteText(str);

str.Printf(wxT("%8u"),pNav->iterations); iter->Clear(); iter->WriteText(str);
str.Printf(wxT("%15.2f"),pNav->gdop); gdop->Clear(); gdop->WriteText(str);
str.Printf(wxT("%.5e"),pPPS->err_lp); ppserr->Clear(); ppserr->WriteText(str);
str.Printf(wxT("%.5e"),pPPS->feedback*SPEED_OF_LIGHT); ppscmd->Clear(); ppscmd->WriteText(str);
str.Printf(wxT("%.5e"),pPPS->clock_rate*SPEED_OF_LIGHT);ppscr->Clear(); ppscr->WriteText(str);

if(pPPS->state)
ppsstate->SetLabel(wxT("Slow Slew"));
{
ppsstate->Clear(); ppsstate->WriteText(wxT("Slow Slew"));
}
else
ppsstate->SetLabel(wxT("Fast Slew"));
{
ppsstate->Clear(); ppsstate->WriteText(wxT("Fast Slew"));
}

/* Get into unix time */
if(pTOT->valid)
{
utcsec = floor(pTOT->second);
utcsec += (pTOT->week + 1024*CURRENT_GPS_WEEK_ROLLOVER)*SECONDS_IN_WEEK;
utcsec += (pTOT->week)*SECONDS_IN_WEEK;
utcsec += (pTOT->day)*SECONDS_IN_DAY;
utcsec -= 10; //Difference of TAI and UTC
utcsec -= 10; //!< Difference of TAI and UTC
utcsec += 315964819; //!< 0 Unix time --> GPS time offset

theTime.Set(utcsec);
str = theTime.FormatISODate();
str += wxT('\t');
str += wxT(' ');
str += theTime.FormatISOTime();
str2.Printf(wxT("%15.6f"),fmod(pTOT->second,1.0));
str += str2;
utct->SetLabel(str);
str2.Printf(wxT("%.6f"),fmod(pTOT->second,1.0));
str += str2.Mid(1,wxSTRING_MAXLEN);
utct->Clear(); utct->WriteText(str);
}
else
{
utcsec = 0;
utct->SetLabel(wxT("No UTC Information\n"));
utct->Clear(); utct->WriteText(wxT("No UTC Information"));
}

}
4 changes: 2 additions & 2 deletions gse/src/gui_select.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ GUI_Select::GUI_Select():iGUI_Select(NULL, wxID_ANY, wxT("SV Select"), wxDefault
int32 strwidth;
wxString str;

str = wxT("Ch# Vis Elev Azim Doppler Time");
str = wxT("Ch# Vis Elev Azim Doppler Time ");
strwidth = str.Length()+3;
SetSize(tDisplay->GetCharWidth()*strwidth, tDisplay->GetCharHeight()*(MAX_SV+2) + 280);
SetSize(tDisplay->GetCharWidth()*strwidth, tDisplay->GetCharHeight()*(MAX_SV+3) + 280);

}

Expand Down
Loading

0 comments on commit 42f8461

Please sign in to comment.