1.解决问题: 新版本moveit配置摄像头出现的问题
无法通过moveit配置助手配置3D perception ,采用手动设置yaml文件的方法
①需要配置的文件:/zbs_catkin_ws/src/marm_moveit_config/config/sensors_3d.yaml
Point Cloud格式:
sensors:
- sensor_plugin: occupancy_map_monitor/PointCloudOctomapUpdater
point_cloud_topic: /head_mount_kinect/depth_registered/points
max_range: 5.0
point_subsample: 1
padding_offset: 0.1
padding_scale: 1.0
filtered_cloud_topic: filtered_cloud
深度图rgbd格式:
sensors:
- sensor_plugin: occupancy_map_monitor/DepthImageOctomapUpdater
image_topic: /head_mount_kinect/depth_registered/image_raw
queue_size: 5
near_clipping_plane_distance: 0.3
far_clipping_plane_distance: 5.0
shadow_threshold: 0.2
padding_scale: 4.0
padding_offset: 0.03
filtered_cloud_topic: filtered_cloud
/zbs_catkin_ws/src/marm_moveit_config/launch/sensor_manager.launch.xml
格式:
<launch>
<!-- This file makes it easy to include the settings for sensor managers -->
<!-- Params for 3D sensors config -->
<rosparam command="load" file="$(find marm_moveit_config)/config/sensors_3d.yaml" />
<!-- Params for the octomap monitor -->
<!-- <param name="octomap_frame" type="string" value="some frame in which the robot moves" /> -->
<param name="octomap_resolution" type="double" value="0.025" />
<param name="max_range" type="double" value="5.0" />
<!-- Load the robot specific sensor manager; this sets the moveit_sensor_manager ROS parameter -->
<arg name="moveit_sensor_manager" default="marm" />
<include file="$(dirname)/$(arg moveit_sensor_manager)_moveit_sensor_manager.launch.xml" />
</launch>
/zbs_catkin_ws/src/marm_moveit_config/launch/marm_moveit_sensor_manager.launch.xml
一般空文件即可
②启动demo_gazebo.launch时没有出现点云图,原因是 robot_state_publisher没有打开,robot_state_publisher用于发布机器人的位置信息。
demo_gazebo启动时需要使用demo.launch文件,
需要对moveit 配置助手生成的demo.launch文件做出如下改动:
<group if="$(eval arg('moveit_controller_manager') == 'fake')">
<!-- We do not have a real robot connected, so publish fake joint states via a joint_state_publisher
MoveIt's fake controller's joint states are considered via the 'source_list' parameter -->
<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" unless="$(arg use_gui)">
<rosparam param="source_list">[move_group/fake_controller_joint_states]</rosparam>
</node>
<!-- If desired, a GUI version is available allowing to move the simulated robot around manually
This corresponds to moving around the real robot without the use of MoveIt. -->
<node name="joint_state_publisher" pkg="joint_state_publisher_gui" type="joint_state_publisher_gui" if="$(arg use_gui)">
<rosparam param="source_list">[move_group/fake_controller_joint_states]</rosparam>
</node>
</group>
<!-- Given the published joint states, publish tf for the robot links -->
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" respawn="true" output="screen" />
因为demo_gazebo给入demo.launch文件的参数为ALL TRUE,影响到了这里robot_state_publisher的启动。
相机,点云,深度图等的显示都需要用到TF坐标系转换。