# How to use --extrinsics with ouster-cli for SLAM testing (OSF from PCAP)

**URL:** <https://community.ouster.com/t/how-to-use-extrinsics-with-ouster-cli-for-slam-testing-osf-from-pcap/364>\
**Category:** Software\
**Tags:** sdk\
**Created:** [June 18, 2025, 6:54am UTC](https://community.ouster.com/t/how-to-use-extrinsics-with-ouster-cli-for-slam-testing-osf-from-pcap/364 "2025-06-18T06:54:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![victo](https://avatars.discourse-cdn.com/v4/letter/v/d78d45/32.png) [@victo](https://community.ouster.com/u/victo)\
**Post date:** [June 18, 2025, 6:54am UTC](https://community.ouster.com/t/how-to-use-extrinsics-with-ouster-cli-for-slam-testing-osf-from-pcap/364/1 "2025-06-18T06:54:11Z")

</div>

Hi everyone,

I’m currently using **ouster-sdk v0.14.0** on **Windows 11 Home**.

I have some data collected while **driving around a parking lot** , and I would like to test the SLAM functionality included in the SDK using this dataset. The data was originally in **PCAP** format and I’ve converted it to **OSF**.

I tried running the following command with the `--extrinsics` option:

```auto
ouster-cli source test.osf --extrinsics "0,5,0,0,0,0" slam viz

```

However, the command doesn’t seem to work as expected.  
Could anyone clarify the **correct way to use `--extrinsics`** with an OSF file for SLAM testing?

Any guidance would be greatly appreciated.  
Thank you in advance!

---

<div class="post-metadata">

**Author:** ![tom](https://yyz2.discourse-cdn.com/flex004/user_avatar/community.ouster.com/tom/32/69_2.png) [@tom](https://community.ouster.com/u/tom)\
**Post date:** [June 23, 2025, 4:33pm UTC](https://community.ouster.com/t/how-to-use-extrinsics-with-ouster-cli-for-slam-testing-osf-from-pcap/364/2 "2025-06-23T16:33:55Z")

</div>

Hi @victo !

Options and flags, including the `--extrinsics` option, have to follow a command, e.g. `source`.

As such, the command should take the form

```auto
ouster-cli source --extrinsics "0,5,0,0,0,0" test.osf slam viz

```

The `--extrinsics` option can take many forms of input. Here’s the explanation from the help text for the `source` command:

```auto
  -e, --extrinsics TEXT Use this arg to adjust Lidar sensor extrinsics of
                             the source. Supported formats:
                             
                             -e extrinsics.json ; A json file containing a per
                             sensor extrinsics
                             
                             -e identity ; Use this to override any stored
                             extrinsics with identity matrix
                             
                             -e X,Y,Z,R,P,Y ; 'X Y Z' for position (meters),
                             'R P Y' represent euler angles (deg)
                             
                             -e X,Y,Z,QX,QY,QZ,QW ; 'X Y Z' for position
                             (meters), 'QX, QY QZ, QW' represent a quaternion
                             
                             -e n1,n2,..,n16 ; 16 float representing a 2D
                             array in a row-major order
                             
                             If more than one sensor is present in the source
                             and this argument is used then the same
                             extrinsics will be applied to all sensors except
                             when using an extrinsics file.

```

I hope this helps! Please let me know if you have any further questions.

Cheers,  
Tom

---

<div class="post-metadata">

**Author:** ![victo](https://avatars.discourse-cdn.com/v4/letter/v/d78d45/32.png) [@victo](https://community.ouster.com/u/victo)\
**Post date:** [July 23, 2025, 2:43am UTC](https://community.ouster.com/t/how-to-use-extrinsics-with-ouster-cli-for-slam-testing-osf-from-pcap/364/3 "2025-07-23T02:43:44Z")

</div>

> [@tom](#):
>
> `-e extrinsics.json`

@tom  
Hi Tom!  
Thank you for your previous response — it was very helpful, and I was able to get it working successfully.

I would now like to test some of the other options, particularly the use of `-e extrinsics.json`. It seems that this file cannot be generated directly by the SDK, so I would like to create it manually.

Specifically, I am planning to connect and use three to four sensors simultaneously, and I understand that an `extrinsics.json` file is required for this configuration. However, I am unsure of the exact format and structure this file should follow.

Could you kindly share the correct format or a sample of how the `extrinsics.json` file should be structured?

Thank you in advance for your assistance.

Best regards,  
Victo

---

<div class="post-metadata">

**Author:** ![Samahu](https://yyz2.discourse-cdn.com/flex004/user_avatar/community.ouster.com/samahu/32/39_2.png) [@Samahu](https://community.ouster.com/u/Samahu)\
**Post date:** [July 23, 2025, 4:04pm UTC](https://community.ouster.com/t/how-to-use-extrinsics-with-ouster-cli-for-slam-testing-osf-from-pcap/364/4 "2025-07-23T16:04:09Z")

</div>

Here is a sample extriniscs.json file showing three sensors (the source\_frame is the sensor serial number that the transform will be applied to):

```json
{
    "transforms": [
      {
        "destination_frame": "world",
        "p_x": 12.900038003921509,
        "p_y": 54.88382339477539,
        "p_z": 15.093940734863281,
        "q_w": 0.7467111945152283,
        "q_x": -0.14726592600345612,
        "q_y": 0.10559403151273727,
        "q_z": 0.6399883031845093,
        "source_frame": "122150000150"
      },
      {
        "destination_frame": "world",
        "p_x": 15.144094467163086,
        "p_y": -2.7492141723632813,
        "p_z": 13.969382286071777,
        "q_w": 0.9823863506317139,
        "q_x": 0.012154391966760159,
        "q_y": 0.1813080757856369,
        "q_z": 0.04355182126164436,
        "source_frame": "992313000353"
      },
      {
        "destination_frame": "world",
        "p_x": 2.866729736328125,
        "p_y": 54.92229461669922,
        "p_z": 14.699606895446777,
        "q_w": 0.6737944483757019,
        "q_x": -0.2551470398902893,
        "q_y": 0.2224845290184021,
        "q_z": 0.6568117141723633,
        "source_frame": "992225001114"
      }
    ]
}

```

---

<div class="post-metadata">

**Author:** ![victo](https://avatars.discourse-cdn.com/v4/letter/v/d78d45/32.png) [@victo](https://community.ouster.com/u/victo)\
**Post date:** [July 24, 2025, 1:29am UTC](https://community.ouster.com/t/how-to-use-extrinsics-with-ouster-cli-for-slam-testing-osf-from-pcap/364/5 "2025-07-24T01:29:23Z")

</div>

@Samahu  
Thank you for the example!  
I’ll give it a try and see how it works.  
🤟

---

<div class="post-metadata">

**Author:** ![victo](https://avatars.discourse-cdn.com/v4/letter/v/d78d45/32.png) [@victo](https://community.ouster.com/u/victo)\
**Post date:** [August 13, 2025, 1:32am UTC](https://community.ouster.com/t/how-to-use-extrinsics-with-ouster-cli-for-slam-testing-osf-from-pcap/364/6 "2025-08-13T01:32:45Z")

</div>

> [@Samahu](#):
>
> ```auto
> "q_w": 0.7467111945152283,
> "q_x": -0.14726592600345612,
> "q_y": 0.10559403151273727,
> "q_z": 0.6399883031845093,
> 
> ```

Hi Samahu,

Thank you for providing the sample.

I have a question regarding the `-e, --extrinsics TEXT` option in `ouster-cli`. According to the documentation, it supports both `-e X,Y,Z,R,P,Y` and `-e X,Y,Z,QX,QY,QZ,QW` formats. However, in the sample file you shared, the values are represented as `"q_w"`, `"q_x"`, `"q_y"`, and `"q_z"`.

I understand that these represent a quaternion, but I am unsure how to correctly use them. Although there are many calculators that can convert Euler angles to quaternions, the resulting angles do not seem to align properly. Could you please explain the meaning of `"q_w"`, `"q_x"`, `"q_y"`, and `"q_z"`?

Additionally, is it mandatory to use quaternions in `extrinsics.json`, or Instead, is it possible to use Euler angles from a json file?

Best regards,

---

<div class="post-metadata">

**Author:** ![Samahu](https://yyz2.discourse-cdn.com/flex004/user_avatar/community.ouster.com/samahu/32/39_2.png) [@Samahu](https://community.ouster.com/u/Samahu)\
**Post date:** [August 13, 2025, 1:15pm UTC](https://community.ouster.com/t/how-to-use-extrinsics-with-ouster-cli-for-slam-testing-osf-from-pcap/364/7 "2025-08-13T13:15:28Z")

</div>

> Additionally, is it mandatory to use quaternions in `extrinsics.json`

Yes, unfortunately the `extriniscs.json` expects transforms in the form of a quaternion.

The `“q_x"`, `"q_y"`, and `"q_z"` are the imaginary parts of the quaternion (think of it as the axis or rotation) while `“q_w”` is the real part (how much rotation around the axis). Think of a quaternion as a rotation around an axis defined by the `q_x`, `q_y`, `q_z` and `q_w` representing the rotation amount around this axis.

You can use an online calculator or the `scipy` python package to convert between euler angles and quaternions.
