Skip to content

Commit

Permalink
Delete unnecessary #includes from the imu driver directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcsauder authored and dagar committed Jul 9, 2019
1 parent be414f7 commit b495ddb
Show file tree
Hide file tree
Showing 42 changed files with 178 additions and 327 deletions.
8 changes: 4 additions & 4 deletions src/drivers/imu/adis16448/ADIS16448.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@
* @author Lorenz Meier <lm@inf.ethz.ch>
*/

#include <ecl/geo/geo.h>
#include <perf/perf_counter.h>
#include <drivers/device/spi.h>
#include <px4_work_queue/ScheduledWorkItem.hpp>
#include <conversion/rotation.h>
#include <ecl/geo/geo.h>
#include <lib/conversion/rotation.h>
#include <lib/drivers/accelerometer/PX4Accelerometer.hpp>
#include <lib/drivers/barometer/PX4Barometer.hpp>
#include <lib/drivers/gyroscope/PX4Gyroscope.hpp>
#include <lib/drivers/magnetometer/PX4Magnetometer.hpp>
#include <perf/perf_counter.h>
#include <px4_work_queue/ScheduledWorkItem.hpp>

using namespace time_literals;

Expand Down
3 changes: 0 additions & 3 deletions src/drivers/imu/adis16477/ADIS16477.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@

#include "ADIS16477.hpp"

#include <px4_config.h>
#include <ecl/geo/geo.h>

#define DIR_READ 0x00
#define DIR_WRITE 0x80

Expand Down
7 changes: 4 additions & 3 deletions src/drivers/imu/adis16477/ADIS16477.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@
#pragma once

#include <drivers/device/spi.h>
#include <lib/conversion/rotation.h>
#include <perf/perf_counter.h>
#include <ecl/geo/geo.h>
#include <px4_work_queue/ScheduledWorkItem.hpp>
#include <lib/conversion/rotation.h>
#include <lib/drivers/accelerometer/PX4Accelerometer.hpp>
#include <lib/drivers/gyroscope/PX4Gyroscope.hpp>
#include <perf/perf_counter.h>
#include <px4_getopt.h>
#include <px4_work_queue/ScheduledWorkItem.hpp>

class ADIS16477 : public device::SPI, public px4::ScheduledWorkItem
{
Expand Down
2 changes: 0 additions & 2 deletions src/drivers/imu/adis16477/adis16477_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@

#include "ADIS16477.hpp"

#include <px4_getopt.h>

extern "C" { __EXPORT int adis16477_main(int argc, char *argv[]); }

/**
Expand Down
3 changes: 0 additions & 3 deletions src/drivers/imu/adis16497/ADIS16497.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@

#include "ADIS16497.hpp"

#include <px4_config.h>
#include <ecl/geo/geo.h>

#define DIR_READ 0x00
#define DIR_WRITE 0x80

Expand Down
7 changes: 4 additions & 3 deletions src/drivers/imu/adis16497/ADIS16497.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@
#pragma once

#include <drivers/device/spi.h>
#include <lib/conversion/rotation.h>
#include <perf/perf_counter.h>
#include <ecl/geo/geo.h>
#include <px4_work_queue/ScheduledWorkItem.hpp>
#include <lib/conversion/rotation.h>
#include <lib/drivers/accelerometer/PX4Accelerometer.hpp>
#include <lib/drivers/gyroscope/PX4Gyroscope.hpp>
#include <perf/perf_counter.h>
#include <px4_getopt.h>
#include <px4_work_queue/ScheduledWorkItem.hpp>

// TODO : This is a copy of the NuttX CRC32 table
static constexpr uint32_t crc32_tab[] = {
Expand Down
2 changes: 0 additions & 2 deletions src/drivers/imu/adis16497/adis16497_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@

#include "ADIS16497.hpp"

#include <px4_getopt.h>

extern "C" { __EXPORT int adis16497_main(int argc, char *argv[]); }

/**
Expand Down
8 changes: 2 additions & 6 deletions src/drivers/imu/bmi055/BMI055.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,10 @@

#pragma once

#include <drivers/device/integrator.h>
#include <drivers/device/spi.h>
#include <drivers/drv_hrt.h>
#include <lib/conversion/rotation.h>
#include <ecl/geo/geo.h>
#include <lib/perf/perf_counter.h>
#include <px4_config.h>
#include <systemlib/conversions.h>
#include <systemlib/err.h>
#include <px4_getopt.h>
#include <px4_work_queue/ScheduledWorkItem.hpp>

#define DIR_READ 0x80
Expand Down
2 changes: 0 additions & 2 deletions src/drivers/imu/bmi055/BMI055_accel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@

#include "BMI055_accel.hpp"

#include <ecl/geo/geo.h>

/*
list of registers that will be checked in check_registers(). Note
that ADDR_WHO_AM_I must be first in the list.
Expand Down
10 changes: 2 additions & 8 deletions src/drivers/imu/bmi055/BMI055_accel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,9 @@

#pragma once

#include "BMI055.hpp"

#include <drivers/device/spi.h>
#include <drivers/drv_hrt.h>
#include <lib/conversion/rotation.h>
#include <lib/perf/perf_counter.h>
#include <lib/drivers/accelerometer/PX4Accelerometer.hpp>
#include <px4_config.h>
#include <systemlib/conversions.h>

#include "BMI055.hpp"

#define BMI055_DEVICE_PATH_ACCEL "/dev/bmi055_accel"
#define BMI055_DEVICE_PATH_ACCEL_EXT "/dev/bmi055_accel_ext"
Expand Down
10 changes: 2 additions & 8 deletions src/drivers/imu/bmi055/BMI055_gyro.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,9 @@

#pragma once

#include "BMI055.hpp"

#include <drivers/device/spi.h>
#include <drivers/drv_hrt.h>
#include <lib/conversion/rotation.h>
#include <lib/perf/perf_counter.h>
#include <lib/drivers/gyroscope/PX4Gyroscope.hpp>
#include <px4_config.h>
#include <systemlib/conversions.h>

#include "BMI055.hpp"

#define BMI055_DEVICE_PATH_GYRO "/dev/bmi055_gyro"
#define BMI055_DEVICE_PATH_GYRO_EXT "/dev/bmi055_gyro_ext"
Expand Down
3 changes: 0 additions & 3 deletions src/drivers/imu/bmi055/bmi055_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
#include "BMI055_accel.hpp"
#include "BMI055_gyro.hpp"

#include <px4_config.h>
#include <px4_getopt.h>

/** driver 'main' command */
extern "C" { __EXPORT int bmi055_main(int argc, char *argv[]); }

Expand Down
34 changes: 33 additions & 1 deletion src/drivers/imu/bmi160/bmi160.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
/****************************************************************************
*
* Copyright (c) 2018 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name PX4 nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/

#include "bmi160.hpp"
#include <ecl/geo/geo.h>

/*
list of registers that will be checked in check_registers(). Note
Expand Down
50 changes: 39 additions & 11 deletions src/drivers/imu/bmi160/bmi160.hpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,47 @@
#ifndef BMI160_HPP_
#define BMI160_HPP_
/****************************************************************************
*
* Copyright (c) 2018 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name PX4 nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/

#pragma once

#include <px4_config.h>
#include <perf/perf_counter.h>
#include <systemlib/conversions.h>
#include <drivers/drv_hrt.h>
#include <drivers/device/spi.h>
#include <ecl/geo/geo.h>
#include <lib/conversion/rotation.h>
#include <px4_work_queue/ScheduledWorkItem.hpp>
#include <lib/drivers/accelerometer/PX4Accelerometer.hpp>
#include <lib/drivers/gyroscope/PX4Gyroscope.hpp>
#include <perf/perf_counter.h>
#include <px4_getopt.h>
#include <px4_work_queue/ScheduledWorkItem.hpp>
#include <systemlib/conversions.h>

#define DIR_READ 0x80
#define DIR_WRITE 0x00
Expand Down Expand Up @@ -379,7 +411,3 @@ class BMI160 : public device::SPI, public px4::ScheduledWorkItem
};
#pragma pack(pop)
};



#endif /* BMI160_HPP_ */
35 changes: 32 additions & 3 deletions src/drivers/imu/bmi160/bmi160_main.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,38 @@
/****************************************************************************
*
* Copyright (c) 2018 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name PX4 nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/

#include "bmi160.hpp"

#include <px4_config.h>
#include <px4_getopt.h>

/** driver 'main' command */
extern "C" { __EXPORT int bmi160_main(int argc, char *argv[]); }

Expand Down
6 changes: 0 additions & 6 deletions src/drivers/imu/fxas21002c/FXAS21002C.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@

#include "FXAS21002C.hpp"

#include <drivers/drv_hrt.h>
#include <lib/drivers/gyroscope/PX4Gyroscope.hpp>
#include <px4_config.h>
#include <px4_defines.h>
#include <px4_work_queue/ScheduledWorkItem.hpp>

/* SPI protocol address bits */
#define DIR_READ(a) ((a) | (1 << 7))
#define DIR_WRITE(a) ((a) & 0x7f)
Expand Down
6 changes: 2 additions & 4 deletions src/drivers/imu/fxas21002c/FXAS21002C.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,12 @@
#pragma once

#include <drivers/device/spi.h>
#include <drivers/drv_hrt.h>
#include <lib/conversion/rotation.h>
#include <lib/drivers/gyroscope/PX4Gyroscope.hpp>
#include <perf/perf_counter.h>
#include <px4_config.h>
#include <px4_defines.h>
#include <px4_getopt.h>
#include <px4_work_queue/ScheduledWorkItem.hpp>


class FXAS21002C : public device::SPI, public px4::ScheduledWorkItem
{
public:
Expand Down
4 changes: 0 additions & 4 deletions src/drivers/imu/fxas21002c/fxas21002c_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@

#include "FXAS21002C.hpp"

#include <px4_getopt.h>
#include <px4_config.h>
#include <px4_defines.h>

extern "C" { __EXPORT int fxas21002c_main(int argc, char *argv[]); }

/**
Expand Down
Loading

0 comments on commit b495ddb

Please sign in to comment.