修改1:
在 /realsense的catkin 工作环境/src/realsense-ros/realsense2_camera/launch/ 把rs_camera.launch 中的
<arg name="unite_imu_method" default="copy"/>
修改为:
<arg name="unite_imu_method" default="linear_interpolation"/>
分别打开三个terminal,电脑插上realsense d435i,运行以下命令:
roscore
roslaunch realsense2_camera rs_camera.launch
rostopic list
查看是否有 /camera/imu ,有这个的话说明ok
修改2:
dwa_loop_move_base_simulation_object_zhan.launch 文件中修改realsense d435i修改为
<include file="$(find realsense2_camera)/launch/rs_camera.launch"/>
修改3:
dwa_loop_move_base_simulation_object_zhan.launch 文件中,添加TF变换。
<node name="base_imu_link" pkg="tf" type="static_transform_publisher" args="0 0 0 0 3.1415926 0 /base_link /base_imu_link 50"/>
如果是单独的imu传感器,可能需要TF坐标转换。我这里用的reslsense d435i,相机已经做过TFi变换了。所以这一步不需要修改。
修改4:
下载robot_pose_ekf功能包,编译,可能会报错。
– package ‘orocos-bfl’ not found
CMake Error at /usr/share/cmake-2.8/Modules/FindPkgConfig.cmake:283 (message):
A required package was not found
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/FindPkgConfig.cmake:337 (_pkg_check_modules_internal)
robot_pose_ekf/CMakeLists.txt:6 (pkg_check_modules)
原因是:缺少orocos-bfl包 解决方法:安装orocos-bfl包之后重新编译
sudo apt-get install ros-melodic-bfl
或者源码安装:https://aur.archlinux.org/packages/ros-melodic-bfl
cd bfl-release-release-melodic-bfl-0.8.0-0/
mkdir build
cd build
cmake ..
make
sudo make install
修改5:
修改robot_pose_ekf.launch 文件夹内容,修改如下:
<launch>
<node pkg="robot_pose_ekf" type="robot_pose_ekf" name="robot_pose_ekf">
<param name="output_frame" value="odom"/>
<param name="base_footprint_frame" value="base_link"/>
<param name="freq" value="30.0"/>
<param name="sensor_timeout" value="1.0"/>
<param name="odom_used" value="true"/>
<param name="imu_used" value="true"/>
<param name="vo_used" value="false"/>
<remap from="imu_data" to="camera/imu" />
</node>
</launch>
|