Skip to content

Commit

Permalink
cleanup trailing whitespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
flixr committed May 23, 2014
1 parent 774e077 commit 53c70ea
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 56 deletions.
4 changes: 2 additions & 2 deletions conf/modules/gps_ubx_ucenter.xml
Expand Up @@ -13,8 +13,8 @@ Automatically configure any Ublox GPS for paparazzi.
Warning: you still need to tell the driver, which paparazzi port you use.
</description>
<define name="GPS_UBX_UCENTER_RATE" value="250" description="Data output rate in ms"/>
<define name="GPS_UBX_NAV5_DYNAMICS"
value="NAV5_DYN_PORTABLE|NAV5_DYN_FIXED|NAV5_DYN_STATIONARY|NAV5_DYN_PEDESTRIAN|NAV5_DYN_AUTOMOTIVE|NAV5_DYN_SEA|NAV5_DYN_AIRBORNE_1G|NAV5_DYN_AIRBORNE_2G|NAV5_DYN_AIRBORNE_4G"
<define name="GPS_UBX_NAV5_DYNAMICS"
value="NAV5_DYN_PORTABLE|NAV5_DYN_FIXED|NAV5_DYN_STATIONARY|NAV5_DYN_PEDESTRIAN|NAV5_DYN_AUTOMOTIVE|NAV5_DYN_SEA|NAV5_DYN_AIRBORNE_1G|NAV5_DYN_AIRBORNE_2G|NAV5_DYN_AIRBORNE_4G"
description="Dynamic model used by ublox GPS filter. Default:NAV5_DYN_AIRBORNE_2G"/>
<define name="USE_GPS_UBX_RXM_RAW" description="Activate raw measurments (only available on U-Blox T versions)"/>
</doc>
Expand Down
2 changes: 1 addition & 1 deletion conf/ubx.xml
Expand Up @@ -210,7 +210,7 @@

<class name="RXM" ID="0x02">

<!--
<!--
Only available with raw data product variant.
This message contains all information needed to be able to generate a RINEX observation
file.
Expand Down
4 changes: 2 additions & 2 deletions sw/airborne/filters/low_pass_filter.h
Expand Up @@ -202,7 +202,7 @@ static inline void init_second_order_low_pass_int(struct SecondOrderLowPass_int*
filter->b[0] = BFP_OF_REAL(1, INT32_FILT_FRAC);
filter->b[1] = 2*filter->b[0];
filter->i[0] = filter->i[1] = filter->o[0] = filter->o[1] = value;
filter->loop_gain = BFP_OF_REAL(loop_gain_f, INT32_FILT_FRAC);
filter->loop_gain = BFP_OF_REAL(loop_gain_f, INT32_FILT_FRAC);
}

/** Update second order low pass filter state with a new value(fixed point version).
Expand All @@ -217,7 +217,7 @@ static inline int32_t update_second_order_low_pass_int(struct SecondOrderLowPass
+ filter->b[0] * filter->i[1]
- filter->a[0] * filter->o[0]
- filter->a[1] * filter->o[1];

filter->i[1] = filter->i[0];
filter->i[0] = value;
filter->o[1] = filter->o[0];
Expand Down
2 changes: 1 addition & 1 deletion sw/airborne/modules/multi/follow.c
Expand Up @@ -48,7 +48,7 @@
#endif

void follow_init( void ) {

}

void follow_change_wp( unsigned char* buffer ) {
Expand Down
20 changes: 10 additions & 10 deletions sw/ground_segment/misc/natnet2ivy.c
Expand Up @@ -76,7 +76,7 @@ uint16_t min_velocity_samples = 4; ///< The amount of position samples ne
#define MAX_NAMELENGTH 256
#define MAX_RIGIDBODIES 128

#define NAT_PING 0
#define NAT_PING 0
#define NAT_PINGRESPONSE 1
#define NAT_REQUEST 2
#define NAT_RESPONSE 3
Expand Down Expand Up @@ -147,14 +147,14 @@ void natnet_parse(unsigned char *in) {
// Frame number
int frameNumber = 0; memcpy(&frameNumber, ptr, 4); ptr += 4;
printf_natnet("Frame # : %d\n", frameNumber);

// ========== MARKERSETS ==========
// Number of data sets (markersets, rigidbodies, etc)
int nMarkerSets = 0; memcpy(&nMarkerSets, ptr, 4); ptr += 4;
printf_natnet("Marker Set Count : %d\n", nMarkerSets);

for (i=0; i < nMarkerSets; i++)
{
{
// Markerset name
char szName[256];
strcpy(szName, ptr);
Expand Down Expand Up @@ -464,7 +464,7 @@ gboolean timeout_transmit_callback(gpointer data) {
rigidBodies[i].nVelocityTransmit++;
if(rigidBodies[i].nVelocitySamples >= min_velocity_samples) {
// Calculate the derevative of the sum to get the correct velocity (1 / freq_transmit) * (samples / total_samples)
double sample_time = //((double)rigidBodies[i].nVelocitySamples / (double)rigidBodies[i].totalVelocitySamples) /
double sample_time = //((double)rigidBodies[i].nVelocitySamples / (double)rigidBodies[i].totalVelocitySamples) /
((double)rigidBodies[i].nVelocityTransmit / (double)freq_transmit);
rigidBodies[i].vel_x = rigidBodies[i].vel_x / sample_time;
rigidBodies[i].vel_y = rigidBodies[i].vel_y / sample_time;
Expand Down Expand Up @@ -492,8 +492,8 @@ gboolean timeout_transmit_callback(gpointer data) {

printf_debug("[%d -> %d]Samples: %d\t%d\t\tTiming: %3.3f latency\n", rigidBodies[i].id, aircrafts[rigidBodies[i].id].ac_id
, rigidBodies[i].nSamples, rigidBodies[i].nVelocitySamples, natnet_latency);
printf_debug(" Heading: %f\t\tPosition: %f\t%f\t%f\t\tVelocity: %f\t%f\t%f\n", DegOfRad(heading),
rigidBodies[i].x, rigidBodies[i].y, rigidBodies[i].z,
printf_debug(" Heading: %f\t\tPosition: %f\t%f\t%f\t\tVelocity: %f\t%f\t%f\n", DegOfRad(heading),
rigidBodies[i].x, rigidBodies[i].y, rigidBodies[i].z,
rigidBodies[i].ecef_vel.x, rigidBodies[i].ecef_vel.y, rigidBodies[i].ecef_vel.z);

// Transmit the REMOTE_GPS packet on the ivy bus
Expand Down Expand Up @@ -545,10 +545,10 @@ static gboolean sample_data(GIOChannel *chan, GIOCondition cond, gpointer data)
return TRUE;
}


/** Print the program help */
void print_help(char* filename) {
static const char *usage =
static const char *usage =
"Usage: %s [options]\n"
" Options :\n"
" -h, --help Display this help\n"
Expand Down Expand Up @@ -595,7 +595,7 @@ static void parse_options(int argc, char** argv) {
// Set the verbosity level
if(strcmp(argv[i], "--verbosity") == 0 || strcmp(argv[i], "-v") == 0) {
check_argcount(argc, argv, i, 1);

verbose = atoi(argv[++i]);
}

Expand Down Expand Up @@ -743,7 +743,7 @@ int main(int argc, char** argv)
IvyStart(ivy_bus);

// Create the main timers
printf_debug("Starting transmitting and sampling timeouts (transmitting frequency: %dHz, minimum velocity samples: %d)\n",
printf_debug("Starting transmitting and sampling timeouts (transmitting frequency: %dHz, minimum velocity samples: %d)\n",
freq_transmit, min_velocity_samples);
g_timeout_add(1000/freq_transmit, timeout_transmit_callback, NULL);

Expand Down
80 changes: 40 additions & 40 deletions sw/tools/gps_ublox_conf/ublox_conf.c
@@ -1,6 +1,6 @@
/*
* Paparazzi ublox gps rx configurator $Id$
*
*
* Copyright (C) 2005 Martin Mueller
*
* This file is part of paparazzi.
Expand All @@ -18,10 +18,10 @@
* You should have received a copy of the GNU General Public License
* along with paparazzi; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
* Boston, MA 02111-1307, USA.
*
*/

#include <stdio.h>
#include <unistd.h>
#include <errno.h>
Expand Down Expand Up @@ -49,7 +49,7 @@

/* **************** no user servicable part below this line **************** */


#define SYNC_CHAR_1 0xB5
#define SYNC_CHAR_2 0x62
#define BLANK_CHAR ' '
Expand Down Expand Up @@ -132,7 +132,7 @@ static speed_t int_to_baud(unsigned int value)
int wait_for_ack( unsigned char* data, int serial_fd )
{
/* the acknowledge buffer to check if the gps understood it */
unsigned char ack_ack[ACK_ACK_LENGTH] = {
unsigned char ack_ack[ACK_ACK_LENGTH] = {
SYNC_CHAR_1, SYNC_CHAR_2, ACK, ACK_ACK, 0x02, 0x00 };
struct timeval select_tv;
fd_set read_fd_set;
Expand All @@ -142,7 +142,7 @@ int wait_for_ack( unsigned char* data, int serial_fd )
unsigned char data_temp;

ack_index = 0;

/* calc ACK checksum */
ack_ack[6] = *(data+2);
ack_ack[7] = *(data+3);
Expand All @@ -157,7 +157,7 @@ int wait_for_ack( unsigned char* data, int serial_fd )

/* 900 msec timeout for reply */
select_tv.tv_sec = 0;
select_tv.tv_usec = 900000;
select_tv.tv_usec = 900000;

while (1)
{
Expand Down Expand Up @@ -206,10 +206,10 @@ int main (int argc, char **argv)
/* this packet saves the just sent CFG commands */
unsigned char cfg_cfg[CFG_CFG_LENGTH] = {
SYNC_CHAR_1, SYNC_CHAR_2, CFG, CFG_CFG, 0x0C, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0xFF, 0xFF,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00 };
0x00, 0x00 };
unsigned char data_temp;

FILE *in_file;
Expand Down Expand Up @@ -238,29 +238,29 @@ int main (int argc, char **argv)
out_file_name = optarg;
break;
}
}
}

if (optind == argc - 1)
{
in_file_name = argv[ optind ];
++optind;
}

if (in_file_name == NULL)
{
// fprintf(stderr, usage_str);
fprintf(stderr,
fprintf(stderr,
"ublox_conf\nConfigures u-blox GPS receivers\n");
fprintf(stderr,
" <file> : configuration file name (example: %s)\n",
IN_FILE_NAME);
fprintf(stderr,
" -d <dev> : GPS device name (default: %s)\n",
fprintf(stderr,
" -d <dev> : GPS device name (default: %s)\n",
OUT_FILE_NAME);
fprintf(stderr,
fprintf(stderr,
" -b <baud> : initial GPS receiver baud rate (default: %d)\n",
DEFAULT_BAUDRATE);
fprintf(stderr,
fprintf(stderr,
" -s <0|1> : save config to Flash/battery backed RAM (default: %d)\n",
SAVE_PERMANENT);
fprintf(stderr,
Expand All @@ -287,54 +287,54 @@ int main (int argc, char **argv)
return( -1 );
}

if (tcgetattr(serial_fd, &orig_termios))
if (tcgetattr(serial_fd, &orig_termios))
{
perror("getting modem serial device attr");
return( -1 );
}

cur_termios = orig_termios;

/* input modes */
cur_termios.c_iflag &= ~(IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK|ISTRIP|INLCR|IGNCR
|ICRNL |IXON|IXANY|IXOFF|IMAXBEL);

/* IGNCR does not pass 0x0D */
cur_termios.c_iflag |= BRKINT;

/* output_flags */
cur_termios.c_oflag &=~(OPOST|ONLCR|OCRNL|ONOCR|ONLRET);

/* control modes */
cur_termios.c_cflag &= ~(CSIZE|CSTOPB|CREAD|PARENB|PARODD|HUPCL|CLOCAL|CRTSCTS);
cur_termios.c_cflag |= CREAD|CS8|CLOCAL;

/* local modes */
cur_termios.c_lflag &= ~(ISIG|ICANON|IEXTEN|ECHO|FLUSHO|PENDIN);
cur_termios.c_lflag |= NOFLSH;

if (cfsetispeed(&cur_termios, B0))
{
perror("setting input modem serial device speed");
return( -1 );
}

if (cfsetospeed(&cur_termios, br))
{
perror("setting modem serial device speed");
return( -1 );
}

if (tcsetattr(serial_fd, TCSADRAIN, &cur_termios))
{
perror("setting modem serial device attr");
return( -1 );
}

while (!feof(in_file))
{
/* search for first ' ' character */
while( ((data_temp = fgetc(in_file)) != BLANK_CHAR) &&
while( ((data_temp = fgetc(in_file)) != BLANK_CHAR) &&
(!feof(in_file)) )
{
printf("%c", data_temp);
Expand All @@ -349,7 +349,7 @@ int main (int argc, char **argv)
}

/* search for second ' ' character */
while( (fgetc(in_file) != BLANK_CHAR) &&
while( (fgetc(in_file) != BLANK_CHAR) &&
(!feof(in_file)) ){}

if (feof(in_file)) break;
Expand Down Expand Up @@ -383,7 +383,7 @@ int main (int argc, char **argv)
}

data_temp = fgetc(in_file);

if ( (data_temp <= '9') && (data_temp >= '0') )
{
data[count] += (data_temp - '0');
Expand All @@ -405,7 +405,7 @@ int main (int argc, char **argv)
}
count++;
}
while( (fgetc(in_file) == BLANK_CHAR) &&
while( (fgetc(in_file) == BLANK_CHAR) &&
(!feof(in_file)) );

if ( (data[4] + (data[5] << 8) + 4) != count-2)
Expand All @@ -423,10 +423,10 @@ int main (int argc, char **argv)
data[count] = data[count] + data[i];
data[count+1] = data[count+1] + data[count];
}

/* send data */
write(serial_fd, data, count+2);

/* did we configure something: check for acknowledge */
if (data[2] == CFG)
{
Expand All @@ -437,7 +437,7 @@ int main (int argc, char **argv)
(data[6+9] << 8) +
(data[6+10] << 16) +
(data[6+11] << 24);

if (data[6] == ublox_port)
{
sleep(1);
Expand Down Expand Up @@ -467,7 +467,7 @@ int main (int argc, char **argv)
}
}
}

wait_for_ack( data, serial_fd );
}
/* monitor command? */
Expand All @@ -489,8 +489,8 @@ int main (int argc, char **argv)
printf("-\n");
}

}
}

/* save it forever? */
if (save_perm != 0)
{
Expand All @@ -501,12 +501,12 @@ int main (int argc, char **argv)
cfg_cfg[count] = cfg_cfg[count] + cfg_cfg[i];
cfg_cfg[count+1] = cfg_cfg[count+1] + cfg_cfg[count];
}

/* send data */
write(serial_fd, cfg_cfg, count+2);

wait_for_ack( cfg_cfg, serial_fd );
}
}

fclose(in_file);
close(serial_fd);
Expand Down

0 comments on commit 53c70ea

Please sign in to comment.