This project contains an ESP32 driver to read pressure and temperature from a BMP280 sensor and a ROS driver estimate the current altitude related to sea level using the sensor's data.
- ESP32 Development KIT;
- BMP280 I2C Pressure and Temperature Sensor;
- a good computer. ( * ▽ * )=b
- ArduinoIDE;
- Python 3.5 (used version 3.5.2);
- ROS (used Kinetic).
- Connect the BMP280 sensor to ESP32 correctly;
- Connect the ESP32 to the computer (USB) and upload the barometer driver available at /barometer/barometer.ino;
- Initiate ROS by typing the commands:
$ source /opt/ros/kinetic/setup.bash
$ roscore &
- Activate the virtualenv in which the required python libraries are already installed:
$ source /venv/bin/activate
- Run the altimeter node script at /altimeter_node/altimeter_node.py:
$ python altimeter_node/altimeter_node.py
With the sensor and Altimeter node up, the pressure, temperature and altitude estimation are published on topics:
- /pressure/data
- type: sensor_msgs.msg.FluidPressure
- /temperature/data
- type: sensor_msgs.msg.Temperature
- /altitude/data
- type: geometry_msgs.msg.PointStamped
- considering it only provides the altitude estimation, on PointStamped point data only the 'z' is filled (PointStamped.data.z)