{
  "id": 115483,
  "title": "Question on ego pose translations",
  "url": "/competitions/3d-object-detection-for-autonomous-vehicles/discussion/115483",
  "author_name": "",
  "post_date": "2019-11-03T04:45:41.114913100Z",
  "votes": null,
  "comment_count": 3,
  "views": 0,
  "content": "<p>Tried plotting X,Y values from ego pose translations. Plot seems to indicate camera front left , front and front right are all in exactly the same center line tracing the direction of the car. I was expecting  left and right to be offset from the front.</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3747125%2F926edd59b0d9a7d92f8ee5a459cb4e05%2Fxy_plot_ep_translations.png?generation=1572756254621734&amp;alt=media\" alt=\"\"></p>\n\n<p><a href=\"https://www.kaggle.com/mpdroid/question-on-ego-pose-translations\">Notebook</a> showing the plot. Is there a gap in understanding? Do the translations also have to be rotated to get the real world X,Y coordinates of each sensor.</p>",
  "messages": [
    {
      "id": "664038",
      "postDate": "11/03/2019 04:45:41",
      "content": "<p>Tried plotting X,Y values from ego pose translations. Plot seems to indicate camera front left , front and front right are all in exactly the same center line tracing the direction of the car. I was expecting  left and right to be offset from the front.</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3747125%2F926edd59b0d9a7d92f8ee5a459cb4e05%2Fxy_plot_ep_translations.png?generation=1572756254621734&amp;alt=media\" alt=\"\"></p>\n\n<p><a href=\"https://www.kaggle.com/mpdroid/question-on-ego-pose-translations\">Notebook</a> showing the plot. Is there a gap in understanding? Do the translations also have to be rotated to get the real world X,Y coordinates of each sensor.</p>",
      "rawMarkdown": "Tried plotting X,Y values from ego pose translations. Plot seems to indicate camera front left , front and front right are all in exactly the same center line tracing the direction of the car. I was expecting  left and right to be offset from the front.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3747125%2F926edd59b0d9a7d92f8ee5a459cb4e05%2Fxy_plot_ep_translations.png?generation=1572756254621734&amp;alt=media)\n\n[Notebook](https://www.kaggle.com/mpdroid/question-on-ego-pose-translations) showing the plot. Is there a gap in understanding? Do the translations also have to be rotated to get the real world X,Y coordinates of each sensor.",
      "votes": null
    },
    {
      "id": "664151",
      "postDate": "11/03/2019 08:41:08",
      "content": "<p>You gotta rotate them after translation.</p>",
      "rawMarkdown": "You gotta rotate them after translation.",
      "votes": null
    },
    {
      "id": "664310",
      "postDate": "11/03/2019 13:31:42",
      "content": "<p>ok figured out the correct transforms I think. Is this correct?\n<code>\nsensor_coords_in_world =  np.add(\n    ego_pose_translation, <br>\n    Quaternion(ego_pose_rotation)\n         .rotate(calibrated_sensor_translation)  )\n</code></p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3747125%2Fa54f85e6a42d3d16f68da63fd495879c%2Fxy_plot_sensors.png?generation=1572805718402098&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "ok figured out the correct transforms I think. Is this correct?\n````\nsensor_coords_in_world =  np.add(\n    ego_pose_translation,  \n    Quaternion(ego_pose_rotation)\n         .rotate(calibrated_sensor_translation)  )\n````\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3747125%2Fa54f85e6a42d3d16f68da63fd495879c%2Fxy_plot_sensors.png?generation=1572805718402098&amp;alt=media)",
      "votes": null
    },
    {
      "id": "664505",
      "postDate": "11/03/2019 18:58:57",
      "content": "<p>I got same result but sensor_vector for lidar front right and left need be with sign minus. Just need time for experiments to figure out why. </p>\n\n<p><img src=\"https://www.kaggleusercontent.com/kf/22945358/eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2In0..xL-mNlUkxv2YH5fi1ZLo3g.GglRN8SV0u0Ext6RWFvDVrnIRY1eLirU_HErqeQxAZ0IFBrI01oJff0CAYxob8Z7__S1-AyOgJDB62FY6LGep6LZk1ANrHXI9LQ02bAfsb8DE-dk1Fiwqc5TO_0BE4HHCb54dlc4vJ_Y0JlBIVQFipc6d0LDs_-5MMwKnLGYC51Gh_2fvJgULiUPGajL9nCh.f-WGOBuGDUmM01DJpA4Vsw/__results___files/__results___14_0.png\" alt=\"\"></p>\n\n<p>sample_cam_token = my_sample['data']['CAM_FRONT']</p>\n\n<p>cam = lyft_dataset.get('sample_data', sample_cam_token)</p>\n\n<p>cs_record = lyft_dataset.get('calibrated_sensor', cam['calibrated_sensor_token'])</p>\n\n<p>sensor_vector = np.dot(Quaternion(poserecord[\"rotation\"]).rotation_matrix, cs_record[\"translation\"])</p>\n\n<p>poserecord = lyft_dataset.get(\"ego_pose\", cam[\"ego_pose_token\"])</p>\n\n<p>x.append(poserecord[\"translation\"][0] + sensor_vector[0])\n y.append(poserecord[\"translation\"][1] + sensor_vector[1])</p>",
      "rawMarkdown": "I got same result but sensor_vector for lidar front right and left need be with sign minus. Just need time for experiments to figure out why. \n\n![](https://www.kaggleusercontent.com/kf/22945358/eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2In0..xL-mNlUkxv2YH5fi1ZLo3g.GglRN8SV0u0Ext6RWFvDVrnIRY1eLirU_HErqeQxAZ0IFBrI01oJff0CAYxob8Z7__S1-AyOgJDB62FY6LGep6LZk1ANrHXI9LQ02bAfsb8DE-dk1Fiwqc5TO_0BE4HHCb54dlc4vJ_Y0JlBIVQFipc6d0LDs_-5MMwKnLGYC51Gh_2fvJgULiUPGajL9nCh.f-WGOBuGDUmM01DJpA4Vsw/__results___files/__results___14_0.png)\n\n sample_cam_token = my_sample['data']['CAM_FRONT']\n \n cam = lyft_dataset.get('sample_data', sample_cam_token)\n \n cs_record = lyft_dataset.get('calibrated_sensor', cam['calibrated_sensor_token'])\n\n sensor_vector = np.dot(Quaternion(poserecord[\"rotation\"]).rotation_matrix, cs_record[\"translation\"])\n \n poserecord = lyft_dataset.get(\"ego_pose\", cam[\"ego_pose_token\"])\n    \n x.append(poserecord[\"translation\"][0] + sensor_vector[0])\n y.append(poserecord[\"translation\"][1] + sensor_vector[1])",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 664151,
      "author_name": "rishabhiitbhu",
      "author_url": "",
      "post_date": "11/03/2019 08:41:08",
      "content": "<p>You gotta rotate them after translation.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 664310,
      "author_name": "mpdroid",
      "author_url": "",
      "post_date": "11/03/2019 13:31:42",
      "content": "<p>ok figured out the correct transforms I think. Is this correct?\n<code>\nsensor_coords_in_world =  np.add(\n    ego_pose_translation, <br>\n    Quaternion(ego_pose_rotation)\n         .rotate(calibrated_sensor_translation)  )\n</code></p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3747125%2Fa54f85e6a42d3d16f68da63fd495879c%2Fxy_plot_sensors.png?generation=1572805718402098&amp;alt=media\" alt=\"\"></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 664505,
      "author_name": "rustemiskuzhin",
      "author_url": "",
      "post_date": "11/03/2019 18:58:57",
      "content": "<p>I got same result but sensor_vector for lidar front right and left need be with sign minus. Just need time for experiments to figure out why. </p>\n\n<p><img src=\"https://www.kaggleusercontent.com/kf/22945358/eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2In0..xL-mNlUkxv2YH5fi1ZLo3g.GglRN8SV0u0Ext6RWFvDVrnIRY1eLirU_HErqeQxAZ0IFBrI01oJff0CAYxob8Z7__S1-AyOgJDB62FY6LGep6LZk1ANrHXI9LQ02bAfsb8DE-dk1Fiwqc5TO_0BE4HHCb54dlc4vJ_Y0JlBIVQFipc6d0LDs_-5MMwKnLGYC51Gh_2fvJgULiUPGajL9nCh.f-WGOBuGDUmM01DJpA4Vsw/__results___files/__results___14_0.png\" alt=\"\"></p>\n\n<p>sample_cam_token = my_sample['data']['CAM_FRONT']</p>\n\n<p>cam = lyft_dataset.get('sample_data', sample_cam_token)</p>\n\n<p>cs_record = lyft_dataset.get('calibrated_sensor', cam['calibrated_sensor_token'])</p>\n\n<p>sensor_vector = np.dot(Quaternion(poserecord[\"rotation\"]).rotation_matrix, cs_record[\"translation\"])</p>\n\n<p>poserecord = lyft_dataset.get(\"ego_pose\", cam[\"ego_pose_token\"])</p>\n\n<p>x.append(poserecord[\"translation\"][0] + sensor_vector[0])\n y.append(poserecord[\"translation\"][1] + sensor_vector[1])</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "664038": "Tried plotting X,Y values from ego pose translations. Plot seems to indicate camera front left , front and front right are all in exactly the same center line tracing the direction of the car. I was expecting  left and right to be offset from the front.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3747125%2F926edd59b0d9a7d92f8ee5a459cb4e05%2Fxy_plot_ep_translations.png?generation=1572756254621734&amp;alt=media)\n\n[Notebook](https://www.kaggle.com/mpdroid/question-on-ego-pose-translations) showing the plot. Is there a gap in understanding? Do the translations also have to be rotated to get the real world X,Y coordinates of each sensor.",
    "664151": "You gotta rotate them after translation.",
    "664310": "ok figured out the correct transforms I think. Is this correct?\n````\nsensor_coords_in_world =  np.add(\n    ego_pose_translation,  \n    Quaternion(ego_pose_rotation)\n         .rotate(calibrated_sensor_translation)  )\n````\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3747125%2Fa54f85e6a42d3d16f68da63fd495879c%2Fxy_plot_sensors.png?generation=1572805718402098&amp;alt=media)",
    "664505": "I got same result but sensor_vector for lidar front right and left need be with sign minus. Just need time for experiments to figure out why. \n\n![](https://www.kaggleusercontent.com/kf/22945358/eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2In0..xL-mNlUkxv2YH5fi1ZLo3g.GglRN8SV0u0Ext6RWFvDVrnIRY1eLirU_HErqeQxAZ0IFBrI01oJff0CAYxob8Z7__S1-AyOgJDB62FY6LGep6LZk1ANrHXI9LQ02bAfsb8DE-dk1Fiwqc5TO_0BE4HHCb54dlc4vJ_Y0JlBIVQFipc6d0LDs_-5MMwKnLGYC51Gh_2fvJgULiUPGajL9nCh.f-WGOBuGDUmM01DJpA4Vsw/__results___files/__results___14_0.png)\n\n sample_cam_token = my_sample['data']['CAM_FRONT']\n \n cam = lyft_dataset.get('sample_data', sample_cam_token)\n \n cs_record = lyft_dataset.get('calibrated_sensor', cam['calibrated_sensor_token'])\n\n sensor_vector = np.dot(Quaternion(poserecord[\"rotation\"]).rotation_matrix, cs_record[\"translation\"])\n \n poserecord = lyft_dataset.get(\"ego_pose\", cam[\"ego_pose_token\"])\n    \n x.append(poserecord[\"translation\"][0] + sensor_vector[0])\n y.append(poserecord[\"translation\"][1] + sensor_vector[1])"
  },
  "source": "meta"
}