I am using ROS Melodic on Ubuntu 18.04. I was trying to implement orb slam 2 on a usb camera using this tutorial:https://medium.com/@mhamdaan/implementing-orb-slam-on-ubuntu-18-04-ros-melodic-606e668deffa
I followed all the steps mentioned, but when I launch the roslaunch usb_cam usb_cam-test.launch
and roslaunch orb_slam2_ros orb_slam2_p.launch
files together in separate terminals, the code crashes.
I get an error:
Enable localization only: false
[orb_slam2_mono-1] process has died [pid 12015, exit code -11, cmd /home/nidhi/tutorials/devel/lib/orb_slam2_ros/orb_slam2_ros_mono /camera/image_raw:=/camera/rgb/image_raw __name:=orb_slam2_mono __log:=/home/nidhi/.ros/log/3be66574-b74a-11ec-8b99-00e18cb0f65d/orb_slam2_mono-1.log].
log file: /home/nidhi/.ros/log/3be66574-b74a-11ec-8b99-00e18cb0f65d/orb_slam2_mono-1*.log
all processes on machine have died, roslaunch will exit
shutting down processing monitor...
... shutting down processing monitor complete
done
I am not able to understand what is going wrong through this error. Also I'll mention that the roslaunch usb_cam usb_cam-test.launch
. The launch file I'm using for slam is as follows:
<launch>
<node name="orb_slam2_mono" pkg="orb_slam2_ros"
type="orb_slam2_ros_mono" output="screen">
<remap from="camera/camera_info" to="usb_cam/camera_info" />
<remap from="camera/image_raw" to="usb_cam/image_raw" />
<param name="publish_pointcloud" type="bool" value="true" />
<param name="publish_pose" type="bool" value="true" />
<param name="localize_only" type="bool" value="false" />
<param name="reset_map" type="bool" value="true" />
<!-- static parameters -->
<param name="load_map" type="bool" value="false" />
<param name="map_file" type="string" value="map.bin" />
<param name="voc_file" type="string" value="$(find orb_slam2_ros)/orb_slam2/Vocabulary/ORBvoc.txt" />
<param name="pointcloud_frame_id" type="string" value="map" />
<param name="camera_frame_id" type="string" value="camera_link" />
<param name="min_num_kf_in_map" type="int" value="5" />
<!--ORB parameters-->
<param name="/ORBextractor/nFeatures" type="int" value="2000" />
<param name="/ORBextractor/scaleFactor" type="double" value="1.2" />
<param name="/ORBextractor/nLevels" type="int" value="8" />
<param name="/ORBextractor/iniThFAST" type="int" value="20" />
<param name="/ORBextractor/minThFAST" type="int" value="7" />
<!-- Camera parameters -->
<!-- Camera frames per second -->
<param name="camera_fps" type="int" value="30" />
<!-- Color order of the images (0: BGR, 1: RGB. It is ignored if images are grayscale) -->
<param name="camera_rgb_encoding" type="bool" value="true" />
<!--If the node should wait for a camera_info topic to take the camera calibration data-->
<param name="load_calibration_from_cam" type="bool" value="true" />
</node>
</launch>