Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ install:
- wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
- wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
- sudo apt-get update -qq
- sudo apt-get install -qq -y python-rosdep python-catkin-tools python3-vcstool wget
- sudo apt-get install -qq -y libqt4-dev python-catkin-tools python-rosdep python3-vcstool wget
# Install RTIMULib
- bash ${TRAVIS_BUILD_DIR}/sensors/ca_imu/scripts/install_rtimulib.sh
# Install dependencies
- sudo rosdep init
- rosdep update
# Create workspace
Expand Down
24 changes: 16 additions & 8 deletions ca_bringup/launch/minimal.launch
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,29 @@
<arg name="robot_id" default="$(optenv ID 1)" doc="Unique identifier of the robot [1-Inf.)"/>
<arg name="ns" value="create$(arg robot_id)" doc="Namespace of the robot. By default: create1"/>

<arg name="raspicam_receiver_IP" default="" doc="Raspicam client IP"/>
<arg name="laser" default="$(optenv LASER)" doc="Laser for mapping the environment"/>
<arg name="raspicam_receiver_IP" default="" doc="Raspicam client IP"/>
<arg name="laser" default="$(optenv LASER)" doc="Laser for mapping the environment"/>

<arg name="rviz" default="$(optenv RVIZ false)" doc="Flag to use RViz"/>
<arg name="imu" default="$(optenv IMU true)" doc="Flag to use the IMU MPU9255"/>

<include file="$(find ca_node)/launch/create_2.launch"/>

<!-- RViz -->
<!-- TODO: HAVE A PLACE IN COMMON WITH GAZEBO -->
<include if="$(arg rviz)" file="$(find ca_tools)/launch/rviz.launch"/>

<!-- raspicam -->
<include if="$(eval arg('raspicam_receiver_IP') != '')" file="$(find ca_visual_odometry)/launch/raspicam_stream.launch">
<!-- <include if="$(eval arg('raspicam_receiver_IP') != '')"
file="$(find ca_visual_odometry)/launch/raspicam_stream.launch">
<arg name="IP" value="$(arg raspicam_receiver_IP)"/>
</include>
</include> -->

<!-- IMU -->
<!-- <include file="$(find ca_imu)/launch/imu.launch"/> -->

<!-- Mapping sensors -->
<group ns="$(arg ns)">
<!-- IMU -->
<include if="$(arg imu)" file="$(find ca_imu)/launch/mpu9255.launch"/>

<!-- Mapping sensors -->
<include if="$(eval arg('laser')=='astra')" file="$(find ca_camera)/launch/orbbec_astra_pro.launch"/>
<include if="$(eval arg('laser')=='kinect')" file=""/>
<include if="$(eval arg('laser')=='r200')" file=""/>
Expand Down
4 changes: 4 additions & 0 deletions ca_description/urdf/sensors/imu_sensor.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
</visual>
</link>

<gazebo reference="${link_name}">
<material>Gazebo/BlueGlow</material>
</gazebo>

<gazebo>
<plugin name="${name}" filename="libgazebo_ros_imu.so">
<alwaysOn>true</alwaysOn>
Expand Down
14 changes: 14 additions & 0 deletions docker/create_ros_melodic/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,21 @@ RUN echo ". /opt/ros/${ROS1_DISTRO}/setup.bash" >> /home/${USER}/.bashrc
ENV CATKIN_SETUP_BASH "${WS_DIR}/devel/setup.bash"
RUN echo "[[ -f ${CATKIN_SETUP_BASH} ]] && . ${CATKIN_SETUP_BASH}" >> /home/${USER}/.bashrc

# Install RTIMULib
ENV RTIMULib_PATH="/home/${USER}/RTIMULib"
ENV RTIMULib_BUILD="${RTIMULib_PATH}/Linux/build"
# Clone repo in RTIMULib_PATH
RUN mkdir -p ${RTIMULib_PATH}
RUN git clone https://github.com/RoboticaUtnFrba/RTIMULib.git ${RTIMULib_PATH}
WORKDIR ${RTIMULib_PATH}
# Build and install RTIMULib
RUN mkdir -p ${RTIMULib_BUILD}
WORKDIR ${RTIMULib_BUILD}
RUN cmake -DBUILD_GL=OFF ..
RUN make -j4
USER root
RUN make install
RUN ldconfig

# Workspace
RUN mkdir -p ${WS_DIR}/src/ && \
Expand Down
2 changes: 2 additions & 0 deletions docker/create_ros_melodic_gazebo9/packages.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ gstreamer1.0-tools
libgstreamer1.0-dev
libgstreamer-plugins-base1.0-dev
libgstreamer-plugins-good1.0-dev
libqt4-dev
libudev-dev
python-catkin-lint

Expand All @@ -20,6 +21,7 @@ ros-*-gazebo-ros-control
ros-*-gazebo-ros-pkgs
ros-*-hardware-interface
ros-*-image-proc
ros-*-imu-tools
ros-*-joint-limits-interface
ros-*-joy
ros-*-joy-teleop
Expand Down
1 change: 1 addition & 0 deletions docker/create_ubuntu_bionic/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ RUN apt-get update && \
build-essential \
curl \
git \
libqt4-dev \
mesa-utils \
pkg-config \
python-vcstools \
Expand Down
33 changes: 8 additions & 25 deletions docs/INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Prerequisites

* [ROS](http://wiki.ros.org/ROS/Installation) _Kinetic_ or _Melodic_
* [ROS](http://wiki.ros.org/ROS/Installation) _Melodic_
* [Gazebo 9](http://gazebosim.org/tutorials?cat=install&tut=install_ubuntu&ver=9.0#Alternativeinstallation:step-by-step) or higher
* Ubuntu packages: `python-rosdep`, `python-catkin-tools`

Expand All @@ -25,43 +25,26 @@ sudo apt-get install -y python-rosdep python-catkin-tools
git clone https://github.com/RoboticaUtnFrba/create_autonomy.git
```

3. Compile RTIMULib2
3. Install dependencies

I. Install RTIMULib

```bash
cd ~/create_ws/src/RTIMULib2/Linux && mkdir build && cd build
sudo apt-get install -y libqt4-dev
cmake ..
make -j4
sudo make install
sudo ldconfig
cd ~/create_ws
./src/create_autonomy/sensors/ca_imu/scripts/install_rtimulib.sh
```

4. Install dependencies
II. Install other dependencies

``` bash
sudo apt-get install -y gstreamer1.0-tools libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-dev
cd ~/create_ws
sudo apt install -y python3-vcstool
vcs import src < src/create_autonomy/<DEVICE>.repos
rosdep update
rosdep install --from-paths src -i
```

5. Build

5.1. Build RTIMULib2 for Raspberry Pi

``` bash
cd ~/create_ws/src/RTIMULib2/Linux
mkdir build
cd build
cmake ..
make -j4
sudo make install
sudo ldconfig
```

5.2. Build workspace
4. Build workspace

``` bash
cd ~/create_ws
Expand Down
12 changes: 4 additions & 8 deletions rpi.repos
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ repositories:
type: git
url: https://github.com/RoboticaUtnFrba/gscam.git
version: master
# i2c_imu:
# type: git
# url: https://github.com/RoboticaUtnFrba/i2c_imu.git
# version: master
i2c_imu:
type: git
url: https://github.com/RoboticaUtnFrba/i2c_imu.git
version: master
libcreate:
type: git
url: https://github.com/RoboticaUtnFrba/libcreate.git
Expand All @@ -19,10 +19,6 @@ repositories:
type: git
url: https://github.com/RoboticaUtnFrba/ros_astra_camera.git
version: master
# RTIMULib2:
# type: git
# url: https://github.com/RoboticaUtnFrba/RTIMULib2.git
# version: master
viso2:
type: git
url: https://github.com/RoboticaUtnFrba/viso2.git
Expand Down
26 changes: 17 additions & 9 deletions sensors/ca_imu/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,28 +1,36 @@
cmake_minimum_required(VERSION 2.8.3)
project(ca_imu)
## Compile as C++11, supported in ROS Kinetic and newer

add_compile_options(-std=c++11)

## Find catkin macros and libraries
find_library(RTIMULib libRTIMULib.so REQUIRED)

if(RTIMULib-NOTFOUND)
message(FATAL_ERROR
"
You must install RTIMULib:

. ${PROJECT_SOURCE_DIR}/scripts/install_rtimulib.sh
"
)
endif()

find_package(catkin REQUIRED COMPONENTS
geometry_msgs
roscpp
i2c_imu
imu_filter_madgwick
rospy
sensor_msgs
std_msgs
tf
)

catkin_package(CATKIN_DEPENDS
geometry_msgs
roscpp
rospy
sensor_msgs
std_msgs
)

include_directories(${catkin_INCLUDE_DIRS})

install(DIRECTORY scripts
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
USE_SOURCE_PERMISSIONS
PATTERN ".svn" EXCLUDE
)
50 changes: 22 additions & 28 deletions sensors/ca_imu/README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
# IMU (MPU9255 9 DOF)

Interfacing Raspberry Pi with MPU9255:
Interfacing **Nvidia Jetson Nano** with **MPU9255**:

![Connection between RPi and MPU9255](media/wiring.png)
> VCC --> 5V
> GND --> GND
> SCL --> PIN 5
> SDA --> PIN 3

## Installation

### [RTIMULib2](https://github.com/RoboticaUtnFrba/RTIMULib2)
## Setup

Go to the RTIMULib2 directory and compile it:
```bash
sudo usermod -aG i2c $USER

$ sudo i2cdetect -y -r 1
0x68
```
$ cd Linux
$ mkdir build
$ cd build
$ cmake ..
$ make -j4
$ sudo make install
$ sudo ldconfig
```

## [Calibrate IMU](https://github.com/RoboticaUtnFrba/RTIMULib2/blob/master/Calibration.pdf)
## Installation

### [RTIMULib](https://github.com/RoboticaUtnFrba/RTIMULib)

RTIMULib is automatically installed when the repository is compiled using the script located in `ca_imu/scripts/install_rtimulib.sh`.

## [Calibrate IMU](https://github.com/RoboticaUtnFrba/RTIMULib/blob/master/Calibration.pdf)

The normal process is to run the magnetometer min/max option followed by the magnetometer ellipsoid fit option followed finally by the accelerometer min/max option.

The resulting RTIMULib.ini can then be used by any other RTIMULib application.
The resulting `RTIMULib.ini` can then be used by any other RTIMULib application.

```sh
$ RTIMULibCal
```bash
RTIMULibCal
```

### Calibrating the magnetometer
Expand All @@ -38,16 +40,8 @@ $ RTIMULibCal

[This video](https://www.youtube.com/watch?v=CnLtzwCbVc4) shows how the calibration process of the accelerometer has to be made.

## [i2c_imu ROS package](https://github.com/RoboticaUtnFrba/i2c_imu)

```
$ cd catkin_ws/src
$ git clone [email protected]:RoboticaUtnFrba/i2c_imu.git
```

### Running

```bash
roslaunch ca_imu mpu9255.launch
```
$ roslaunch ca_imu imu.launch
$ rviz
```
Loading