Skip to content

Commit

Permalink
GITBOOK-97: In progress
Browse files Browse the repository at this point in the history
  • Loading branch information
aerial-robotics-iitk-bot authored and gitbook-bot committed May 4, 2024
1 parent a0aa7d9 commit baf8fbb
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 0 deletions.
1 change: 1 addition & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
* [Setup with VICON](estimation/setup-with-vicon.md)
* [Odometry from pose data](estimation/odometry-from-pose-data.md)
* [Computer Vision](computer-vision/README.md)
* [IntelRealSense D455 Calibration](computer-vision/intelrealsense-d455-calibration.md)
* [Camera Calibration](computer-vision/camera-calibration.md)
* [ArUco ROS](computer-vision/using-aruco\_ros.md)
* [Machine Learning](machine-learning/README.md)
Expand Down
108 changes: 108 additions & 0 deletions computer-vision/intelrealsense-d455-calibration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
---
description: Calibration of IntelRealSenseD455 using AprilGrid
---

# IntelRealSense D455 Calibration

### Installing Kalibr

#### Building Kalibr from Source

1. Install the necessary dependencies:

```bash
sudo apt-get install -y git wget autoconf automake nano libeigen3-dev libboost-all-dev libsuitesparse-dev doxygen libopencv-dev libpoco-dev libtbb-dev libblas-dev liblapack-dev libv4l-dev python3-dev python3-pip python3-scipy python3-matplotlib ipython3 python3-wxgtk4.0 python3-tk python3-igraph python3-pyx
```
2. Create and configure a workspace:

```bash
mkdir -p ~/kalibr_workspace/src
cd ~/kalibr_workspace
export ROS1_DISTRO=noetic # Replace 'noetic' with your ROS version
source /opt/ros/$ROS1_DISTRO/setup.bash
catkin init
catkin config --extend /opt/ros/$ROS1_DISTRO
catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release
```
3. Clone the Kalibr project and build it:

```bash
cd ~/kalibr_workspace/src
git clone https://github.com/ethz-asl/kalibr.git
cd ~/kalibr_workspace/
catkin build -DCMAKE_BUILD_TYPE=Release -j4
```

Source the workspace setup:

```bash
source ~/kalibr_workspace/devel/setup.bash
```

### Recording a Rosbag

To record a rosbag, follow these steps:

1. Start ROS using the command:

```bash
roscore
```
2. Install the IntelRealSense ROS package for your ROS distribution:

```bash
sudo apt-get install ros-$ROS_DISTRO-realsense2-camera
source devel/setup.bash
```
3. Launch the camera node using:

```bash
roslaunch realsense2_camera rs_camera.launch
```
4. Check that camera topics are listed with:

```bash
rostopic list
```

You should see topics such as `camera/color/image_raw`.
5. Record a rosbag from all topics:

```bash
rosbag record -a
```

Press Ctrl+C to stop recording. The rosbag will be saved in the current directory.

**Important points during recording:**

* Excite all IMU axes (rotation and translation).
* Avoid shocks, especially at the beginning and end of recording.
* Maintain low motion blur through low shutter times and good illumination.
* Ensure timestamps have low jitter and are synchronized.
6. Check the rosbag info and play it using:

```bash
rosbag info
rosbag play
```



### Calibrating the Camera Using AprilGrid

1. Ensure the AprilGrid details are specified in a `.yaml` file.
2. To calibrate the camera, run the following command in the directory containing the `.yaml` file and rosbag:

```bash
rosrun kalibr kalibr_calibrate_cameras --target [name of .yaml file] --models [camera/distortion models to be fitted] --topics [name of topic where image from camera is being published] --bag [path to rosbag] --bag-freq 10.0 --show-extraction
```

**Notes:**

* The camera distortion model used should be `pinhole-radtan`.
* The `--show-extraction` flag shows the calibration alongside the feed.
* The `--bag-freq 10.0` sets the playback frequency of the rosbag to 10 Hz during calibration.

The results of the calibration process will be saved in a PDF and the matrix parameters will be stored in a `.yaml` file in the same directory.

0 comments on commit baf8fbb

Please sign in to comment.