{
  "id": 115388,
  "title": "Be careful when rotating boxes",
  "url": "/competitions/3d-object-detection-for-autonomous-vehicles/discussion/115388",
  "author_name": "Artyom Palvelev",
  "post_date": "2019-11-02T13:46:00.332000",
  "votes": 7,
  "comment_count": 3,
  "views": 0,
  "content": "<p>I believe Box.rotate() function in Lyft/nuScenes SDKs is broken:\n<a href=\"https://github.com/nutonomy/nuscenes-devkit/blob/master/python-sdk/nuscenes/utils/data_classes.py#L515\">https://github.com/nutonomy/nuscenes-devkit/blob/master/python-sdk/nuscenes/utils/data_classes.py#L515</a></p>\n\n<p>The reason is, you can't simply multiply rotation quaternions if they are using different centers. This means that after you do <code>box.rotate()</code>, your orientation data will contain garbage. A workaround is to recalculate angles using the <code>corners</code> property. </p>",
  "messages": [
    {
      "id": 663667,
      "postDate": "2019-11-02T13:46:00.333Z",
      "content": "<p>I believe Box.rotate() function in Lyft/nuScenes SDKs is broken:\n<a href=\"https://github.com/nutonomy/nuscenes-devkit/blob/master/python-sdk/nuscenes/utils/data_classes.py#L515\">https://github.com/nutonomy/nuscenes-devkit/blob/master/python-sdk/nuscenes/utils/data_classes.py#L515</a></p>\n\n<p>The reason is, you can't simply multiply rotation quaternions if they are using different centers. This means that after you do <code>box.rotate()</code>, your orientation data will contain garbage. A workaround is to recalculate angles using the <code>corners</code> property. </p>",
      "rawMarkdown": "I believe Box.rotate() function in Lyft/nuScenes SDKs is broken:\nhttps://github.com/nutonomy/nuscenes-devkit/blob/master/python-sdk/nuscenes/utils/data_classes.py#L515\n\nThe reason is, you can't simply multiply rotation quaternions if they are using different centers. This means that after you do `box.rotate()`, your orientation data will contain garbage. A workaround is to recalculate angles using the `corners` property. ",
      "votes": 7
    },
    {
      "id": 664460,
      "postDate": "2019-11-03T17:44:10.950Z",
      "content": "<p>There is no bug, but the name <code>rotate</code> is misleading.</p>\n\n<p>In the last SDK version I split rotate into two methods: </p>\n\n<p><code>rotate_around_origin</code> and <code>rotate_around_box_center</code></p>",
      "rawMarkdown": "There is no bug, but the name `rotate` is misleading.\n\nIn the last SDK version I split rotate into two methods: \n\n`rotate_around_origin` and `rotate_around_box_center`",
      "votes": 2
    },
    {
      "id": 663864,
      "postDate": "2019-11-02T19:24:21.817Z",
      "content": "<p>Well, it depends on what we mean by rotation. This function implements rotation around the box center. In this sense, it's probably correct. But it means that we can't really use this function for camera transformations. Hope this helps!</p>",
      "rawMarkdown": "Well, it depends on what we mean by rotation. This function implements rotation around the box center. In this sense, it's probably correct. But it means that we can't really use this function for camera transformations. Hope this helps!"
    },
    {
      "id": 663850,
      "postDate": "2019-11-02T18:48:57.287Z",
      "rawMarkdown": "",
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 664460,
      "author_name": "Vladimir Iglovikov",
      "author_url": "",
      "post_date": "2019-11-03T17:44:10.950000",
      "content": "<p>There is no bug, but the name <code>rotate</code> is misleading.</p>\n\n<p>In the last SDK version I split rotate into two methods: </p>\n\n<p><code>rotate_around_origin</code> and <code>rotate_around_box_center</code></p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 663864,
      "author_name": "Artyom Palvelev",
      "author_url": "",
      "post_date": "2019-11-02T19:24:21.817000",
      "content": "<p>Well, it depends on what we mean by rotation. This function implements rotation around the box center. In this sense, it's probably correct. But it means that we can't really use this function for camera transformations. Hope this helps!</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 663850,
      "author_name": "",
      "author_url": "",
      "post_date": "2019-11-02T18:48:57.287000",
      "content": "",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "663667": "I believe Box.rotate() function in Lyft/nuScenes SDKs is broken:\nhttps://github.com/nutonomy/nuscenes-devkit/blob/master/python-sdk/nuscenes/utils/data_classes.py#L515\n\nThe reason is, you can't simply multiply rotation quaternions if they are using different centers. This means that after you do `box.rotate()`, your orientation data will contain garbage. A workaround is to recalculate angles using the `corners` property. ",
    "664460": "There is no bug, but the name `rotate` is misleading.\n\nIn the last SDK version I split rotate into two methods: \n\n`rotate_around_origin` and `rotate_around_box_center`",
    "663864": "Well, it depends on what we mean by rotation. This function implements rotation around the box center. In this sense, it's probably correct. But it means that we can't really use this function for camera transformations. Hope this helps!",
    "663850": ""
  }
}