Kimera-VIO-ROS icon indicating copy to clipboard operation
Kimera-VIO-ROS copied to clipboard

Using Kimera with AirSim - Datasets and calibration

Open JoKoll opened this issue 4 years ago • 1 comments

I'm looking to use Kimera with AirSim and ROS in a real-time simulation. I've edited the kimera launch file to read the camera information from AirSim by setting the "use_online_cam_params" to "true" and changing the Subscribed topics to the AirSim names. However, when running the kimera launch file, I get the error:

F0611 15:21:42.510151 7724 CameraParams.cpp:91] Unrecognized distortion model for pinhole camera. Valid pinhole distortion model options are 'none', 'radtan', 'equidistant'.

I was looking to follow the instructions to set up hardware, in this hardware documentation, but it looks like the Kalibr2KimeraVIO-pinhole-radtan ROS wrapper no longer exists, so I'm not sure how to calibrate the AirSim cameras with the correct distortion model. The MyntEye S instructions have similar broken links for the calibration and example launch file. I also haven't been able to find a way to calibrate this through AirSim.

Outside of this error, I was also wondering about the Dataset parameter in the launch file. I currently have it set to Euroc, but does it affect anything when I've set the launch file to use the online cam parameters? Or does calibrating the cameras with Kalibr create the dataset folders?

The Kimera launch error in full:

blueksy@BlueSky:~$ roslaunch kimera_vio_ros kimera_vio_airsim.launch
... logging to /home/blueksy/.ros/log/f869d362-cafa-11eb-b07e-d45d64bbac34/roslaunch-BlueSky-7709.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://BlueSky:44865/

SUMMARY
========

PARAMETERS
 * /kimera_vio_ros/kimera_vio_ros_node/base_link_frame_id: drone_1/odom_loca...
 * /kimera_vio_ros/kimera_vio_ros_node/left_cam_frame_id: front_left_c_opti...
 * /kimera_vio_ros/kimera_vio_ros_node/map_frame_id: world_enu
 * /kimera_vio_ros/kimera_vio_ros_node/mono_ransac_threshold: 30
 * /kimera_vio_ros/kimera_vio_ros_node/online_run: True
 * /kimera_vio_ros/kimera_vio_ros_node/params_folder_path: /home/blueksy/cat...
 * /kimera_vio_ros/kimera_vio_ros_node/position_det_threshold: 0.3
 * /kimera_vio_ros/kimera_vio_ros_node/right_cam_frame_id: front_right_c_opt...
 * /kimera_vio_ros/kimera_vio_ros_node/stereo_ransac_threshold: 20
 * /kimera_vio_ros/kimera_vio_ros_node/use_lcd: True
 * /kimera_vio_ros/kimera_vio_ros_node/use_online_cam_params: True
 * /kimera_vio_ros/kimera_vio_ros_node/velocity_det_threshold: 0.1
 * /kimera_vio_ros/kimera_vio_ros_node/world_frame_id: world_enu
 * /kimera_vio_ros/posegraph_viewer/frame_id: world_enu
 * /rosdistro: melodic
 * /rosversion: 1.14.11
 * /use_sim_time: False

NODES
  /kimera_vio_ros/
    kimera_vio_ros_node (kimera_vio_ros/kimera_vio_ros_node)
    posegraph_viewer (pose_graph_tools/visualizer_node)

ROS_MASTER_URI=http://localhost:11311

process[kimera_vio_ros/kimera_vio_ros_node-1]: started with pid [7724]
process[kimera_vio_ros/posegraph_viewer-2]: started with pid [7725]
[ INFO] [1623446501.544735613]: Initializing pose graph visualizer
I0611 15:21:41.656893  7724 RosOnlineDataProvider.cpp:56] Requested initialization from ground-truth. Initializing ground-truth odometry one-shot subscriber.
W0611 15:21:41.660002  7724 RosOnlineDataProvider.cpp:65] Waiting for ground-truth pose to initialize VIO on ros topic: /airsim_node/drone_1/odom_local_ned
W0611 15:21:41.903148  7724 RosOnlineDataProvider.cpp:366] Using initial ground-truth state for initialization.
W0611 15:21:41.905175  7724 RosOnlineDataProvider.cpp:95] Using online camera parameters instead of YAML parameter files.
F0611 15:21:42.510151  7724 CameraParams.cpp:91] Unrecognized distortion model for pinhole camera. Valid pinhole distortion model options are 'none', 'radtan', 'equidistant'.
*** Check failure stack trace: ***
    @     0x7f6c1a21dd9d  google::LogMessage::Fail()
    @     0x7f6c1a2226bc  google::LogMessage::SendToLog()
    @     0x7f6c1a21da9d  google::LogMessage::Flush()
    @     0x7f6c1a21e289  google::LogMessageFatal::~LogMessageFatal()
    @     0x7f6c11f09d77  VIO::CameraParams::stringToDistortion()
    @     0x7f6c19a395f7  VIO::utils::msgCamInfoToCameraParams()
    @     0x7f6c199f5694  VIO::RosOnlineDataProvider::callbackCameraInfo()
    @     0x7f6c199ffd68  boost::detail::function::void_function_obj_invoker9<>::invoke()
    @     0x7f6c19a232f5  message_filters::CallbackHelper9T<>::call()
    @     0x7f6c19a1ce08  message_filters::sync_policies::ApproximateTime<>::publishCandidate()
    @     0x7f6c19a1e468  message_filters::sync_policies::ApproximateTime<>::process()
    @     0x7f6c19a1fbb8  message_filters::sync_policies::ApproximateTime<>::add<>()
    @     0x7f6c1a48b1dd  message_filters::CallbackHelper1T<>::call()
    @     0x7f6c1a482f77  message_filters::Subscriber<>::cb()
    @     0x7f6c1a48b4a8  ros::SubscriptionCallbackHelperT<>::call()
    @     0x7f6c19fbb152  ros::SubscriptionQueue::call()
    @     0x7f6c19f65829  ros::CallbackQueue::callOneCB()
    @     0x7f6c19f675cb  ros::CallbackQueue::callAvailable()
    @     0x7f6c19fa767e  ros::spinOnce()
    @     0x7f6c199f8902  VIO::RosOnlineDataProvider::RosOnlineDataProvider()
    @     0x7f6c199d1fe8  VIO::KimeraVioRos::createDataProvider()
    @     0x7f6c199d29d4  VIO::KimeraVioRos::runKimeraVio()
    @     0x5619bd71b4ed  (unknown)
    @     0x7f6c18449bf7  __libc_start_main
    @     0x5619bd71b9ba  (unknown)
[kimera_vio_ros/kimera_vio_ros_node-1] process has died [pid 7724, exit code -6, cmd /home/blueksy/catkin_ws/devel/lib/kimera_vio_ros/kimera_vio_ros_node --use_lcd=true --vocabulary_path=/home/blueksy/catkin_ws/src/Kimera-VIO/vocabulary/ORBvoc.yml --flagfile=/home/blueksy/catkin_ws/src/Kimera-VIO/params/Euroc/flags/Mesher.flags --flagfile=/home/blueksy/catkin_ws/src/Kimera-VIO/params/Euroc/flags/VioBackend.flags --flagfile=/home/blueksy/catkin_ws/src/Kimera-VIO/params/Euroc/flags/RegularVioBackend.flags --flagfile=/home/blueksy/catkin_ws/src/Kimera-VIO/params/Euroc/flags/Visualizer3D.flags --logtostderr=1 --colorlogtostderr=1 --log_prefix=1 --v=0 --log_output=false --log_euroc_gt_data=false --output_path=/home/blueksy/catkin_ws/src/Kimera-VIO-ROS/output_logs/ --viz_type=0 --visualize=true left_cam/image_raw:=/airsim_node/drone_1/front_left_c/Scene right_cam/image_raw:=/airsim_node/drone_1/front_right_c/Scene imu:=/airsim_node/drone_1/imu/Imu_c gt_odom:=/airsim_node/drone_1/odom_local_ned left_cam/camera_info:=/airsim_node/drone_1/front_left_c/Scene/camera_info right_cam/camera_info:=/airsim_node/drone_1/front_right_c/Scene/camera_info reinit_flag:=reinit_flag reinit_pose:=reinit_pose odometry:=odometry resiliency:=resiliency imu_bias:=imu_bias optimized_trajectory:=optimized_trajectory pose_graph:=pose_graph mesh:=mesh frontend_stats:=frontend_stats debug_mesh_img/image_raw:=debug_mesh_img/image_raw feature_tracks/image_raw:=feature_tracks/image_raw time_horizon_pointcloud:=time_horizon_pointcloud __name:=kimera_vio_ros_node __log:=/home/blueksy/.ros/log/f869d362-cafa-11eb-b07e-d45d64bbac34/kimera_vio_ros-kimera_vio_ros_node-1.log].
log file: /home/blueksy/.ros/log/f869d362-cafa-11eb-b07e-d45d64bbac34/kimera_vio_ros-kimera_vio_ros_node-1*.log

The Kimera-AirSim launch file used:

<launch>
  <!-- General Kimera-VIO-ROS launch file. Change arguments in your own launch
  file and include this one to launch KimeraVIO on the dataset of your choice -->
  <arg name="dataset_name" default="Euroc"/>
  <!-- If False, parses the given rosbag, otw it plays the rosbage -->
  <arg name="online" default="true" />
  <!-- !!!! VIT !!!! This should be true when running online with a rosbag publishing clock,
  but false when parsing rosbag? Needs rosbag to be publishing clock -->
  <arg name="should_use_sim_time" default="false"/>
  <param name="use_sim_time" value="$(arg should_use_sim_time)"/>
  <arg name="rosbag_path" unless="$(arg online)"/>

  <!-- Use CameraInfo topics to get parameters, instead of yaml files -->
  <arg name="use_online_cam_params" default="true"/>

  <!-- If true, KimeraVIO will log output of all modules to the
       'log_output_path' location. -->
  <arg name="log_output" default="false"/>
  <arg name="log_output_path"
       default="$(find kimera_vio_ros)/output_logs/"/>
  <!-- If true, log ground-truth poses to a csv file using the
       gt_logger_node (if online is true) or rosbag (if online is false),
       and processing data from the gt_topic rostopic -->
  <arg name="log_gt_data" default="false"/>
  <arg name="gt_topic"    default="ground_truth_odometry_topic"/>

  <!-- If true, KimeraVIO will enable the LoopClosureDetector module. -->
  <arg name="use_lcd" default="true"/>

  <!-- Parameters -->
  <!-- each dataset has its own set of parameter files -->
  <!-- the parameters are set in param folder, ordered by the dataset's name -->
  <arg name="params_folder" default="$(find kimera_vio)/params/$(arg dataset_name)"/>

  <!-- Specify the absolute path to the vocabulary file. -->
  <!-- This is usually in the VIO directory (VIO/vocabulary/ORBvoc.yml). -->
  <arg name="path_to_vocab" default="$(find kimera_vio)/vocabulary/ORBvoc.yml"/>

  <!-- Subscribed Topics -->
  <arg name="left_cam_topic"                    default="/airsim_node/drone_1/front_left_c/Scene"/>
  <arg name="left_cam_info_topic"               default="/airsim_node/drone_1/front_left_c/Scene/camera_info"/>
  <arg name="right_cam_topic"                   default="/airsim_node/drone_1/front_right_c/Scene"/>
  <arg name="right_cam_info_topic"              default="/airsim_node/drone_1/front_right_c/Scene/camera_info"/>
  <arg name="imu_topic"                         default="/airsim_node/drone_1/imu/Imu_c"/>
  <!-- Empty string ("") means no ground-truth available. Used for init if
   requested to do ground-truth initialization. -->
  <arg name="odometry_ground_truth_topic"       default="/airsim_node/drone_1/odom_local_ned"/>

  <!-- Frame IDs -->
  <arg name="world_frame_id"     default="world_enu"/>
  <arg name="base_link_frame_id" default="drone_1/odom_local_ned"/>
  <arg name="map_frame_id"       default="world_enu"/>
  <arg name="left_cam_frame_id"  default="front_left_c_optical/static"/>
  <arg name="right_cam_frame_id" default="front_right_c_optical/static"/>

  <!-- General parameters -->
  <arg name="verbosity"    default="0" />
  <!-- Publish pipeline output to ROS. -->
  <!-- Note that this is duplicated from the flags file -->
  <arg name="visualize"    default="true" />
  <!-- Type of visualization: 0: 2d3d_mesh, 1: pointcloud, 2: none -->
  <arg name="viz_type"     default="0" />

  <!-- Only here for convenience -->
  <arg name="run_stereo_dense"     default="false"/>

  <!-- Launch main node  -->
  <node name="kimera_vio_ros_node" pkg="kimera_vio_ros" type="kimera_vio_ros_node"
        output="screen" ns="kimera_vio_ros"
        args="--use_lcd=$(arg use_lcd)
              --vocabulary_path=$(arg path_to_vocab)
              --flagfile=$(arg params_folder)/flags/Mesher.flags
              --flagfile=$(arg params_folder)/flags/VioBackend.flags
              --flagfile=$(arg params_folder)/flags/RegularVioBackend.flags
              --flagfile=$(arg params_folder)/flags/Visualizer3D.flags
              --logtostderr=1
              --colorlogtostderr=1
              --log_prefix=1
              --v=$(arg verbosity)
              --log_output=$(arg log_output)
              --log_euroc_gt_data=$(arg log_output)
              --output_path=$(arg log_output_path)
              --viz_type=$(arg viz_type)
              --visualize=$(arg visualize)">
    <param name="params_folder_path"    value="$(arg params_folder)"/>

    <param name="online_run"            value="$(arg online)"/>
    <param name="use_lcd"               value="$(arg use_lcd)"/>
    <param name="use_online_cam_params" value="$(arg use_online_cam_params)"/>

    <!-- Frame IDs for Odometry -->
    <param name="world_frame_id"     value="$(arg world_frame_id)"/>
    <param name="base_link_frame_id" value="$(arg base_link_frame_id)"/>
    <param name="map_frame_id"       value="$(arg map_frame_id)"/>
    <param name="left_cam_frame_id"  value="$(arg left_cam_frame_id)"/>
    <param name="right_cam_frame_id" value="$(arg right_cam_frame_id)"/>

    <!-- Subscriber topics -->
    <!-- if we run online, use remap -->
    <remap from="left_cam/image_raw"  to="$(arg left_cam_topic)"    if="$(arg online)"/>
    <remap from="right_cam/image_raw" to="$(arg right_cam_topic)"   if="$(arg online)"/>
    <remap from="imu"       to="$(arg imu_topic)"                   if="$(arg online)"/>
    <remap from="gt_odom"   to="$(arg odometry_ground_truth_topic)"
           if="$(eval arg('online') and arg('odometry_ground_truth_topic') != '')"/>

    <remap from="left_cam/camera_info"  to="$(arg left_cam_info_topic)"  if="$(arg online)"/>
    <remap from="right_cam/camera_info" to="$(arg right_cam_info_topic)" if="$(arg online)"/>

    <!-- if we run offline, use params -->
    <param name="rosbag_path"            value="$(arg rosbag_path)"     unless="$(arg online)"/>
    <param name="left_cam_rosbag_topic"  value="$(arg left_cam_topic)"  unless="$(arg online)"/>
    <param name="right_cam_rosbag_topic" value="$(arg right_cam_topic)" unless="$(arg online)"/>
    <param name="imu_rosbag_topic"       value="$(arg imu_topic)"       unless="$(arg online)"/>
    <param name="ground_truth_odometry_rosbag_topic"
           value="$(arg odometry_ground_truth_topic)"                   unless="$(arg online)"/>
    <param name="log_gt_data"            value="$(arg log_gt_data)"     unless="$(arg online)"/>

    <!-- Other subscription topics -->
    <remap from="reinit_flag" to="reinit_flag"/>
    <remap from="reinit_pose" to="reinit_pose"/>

    <!-- Remap publisher topics -->
    <remap from="odometry"                       to="odometry"/>
    <remap from="resiliency"                     to="resiliency"/>
    <remap from="imu_bias"                       to="imu_bias"/>
    <remap from="optimized_trajectory"           to="optimized_trajectory"/>
    <remap from="pose_graph"                     to="pose_graph"/>
    <remap from="mesh"                           to="mesh"/>
    <remap from="frontend_stats"                 to="frontend_stats"/>
    <remap from="debug_mesh_img/image_raw"       to="debug_mesh_img/image_raw"/>
    <remap from="feature_tracks/image_raw"       to="feature_tracks/image_raw"/>
    <remap from="time_horizon_pointcloud"        to="time_horizon_pointcloud"/>

    <!-- Resiliency Thresholds: TODO(Sandro) document -->
    <param name="velocity_det_threshold"  value="0.1"/>
    <param name="position_det_threshold"  value="0.3"/>
    <param name="stereo_ransac_threshold" value="20"/>
    <param name="mono_ransac_threshold"   value="30"/>

    <!-- Load calibration -->
    <!-- <rosparam command="load" file="$(arg params_folder)/calibration.yaml"/> -->
  </node>

  <!-- Launch visualizer -->
  <include file="$(find pose_graph_tools)/launch/posegraph_view.launch" >
    <arg name="frame_id"      value="$(arg world_frame_id)" />
    <arg name="graph_topic"   value="pose_graph" />
    <arg name="ns"            value="kimera_vio_ros"/>
  </include>

  <!-- Log ground-truth data only if requested and if not running in offline mode-->
  <node if="$(eval log_gt_data and online)" name="gt_logger_node" pkg="kimera_vio_ros"
        type="gt_logger_node.py" output="screen">
    <param name="gt_topic"   value="$(arg gt_topic)"/>
    <param name="output_dir" value="$(arg log_output_path)"/>
  </node>

</launch>

JoKoll avatar Jun 11 '21 21:06 JoKoll

@JoKoll any update on this?

sandilyasg avatar Oct 03 '23 21:10 sandilyasg