My camera does not move with my robot in rviz
I have installed the camera to my robot and gazebo works fine. However, when I start Rviz, the camera shows all the depth images but it does not move along with a robot and stays static.
Here is my launch file:
<launch>
<!-- Launch Gazebo and load the robot -->
<param
name="robot_description"
command="$(find xacro)/xacro '$(find genius_description)/urdf/genius.xacro'"
/>
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" value="$(find genius_gazebo)/worlds/genius.world" />
</include>
<node name="genius_spawn" pkg="gazebo_ros" type="spawn_model" output="screen"
args="-urdf -param robot_description -model genius" />
<node name="state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"/>
<!-- Launch depth_proc to get the point cloud and depth images -->
<param name="use_sim_time" value="true" />
<arg name="rgb_camera_info" value="/realsense/camera/color/camera_info"/>
<arg name="rgb_img_rect" value="/realsense/camera/color/image_raw"/> <!--Rectified color image-->
<arg name="depReg_imgraw" value="/realsense/camera/depth/image_raw"/> <!--Raw depth image-->
<arg name="depReg_imgrect" value="/realsense/camera/depth/image_rect"/> <!--Raw depth image-->
<arg name="out_cloud" value="/realsense/camera/depth_registered/points"/>
<node pkg="nodelet" type="nodelet" name="standalone_nodelet" args="manager" output="screen"/>
<!-- Convert depth from mm (in uint16) to meters -->
<node pkg="nodelet" type="nodelet" name="convert_metric" args="load depth_image_proc/convert_metric standalone_nodelet">
<remap from="image_raw" to="$(arg depReg_imgraw)"/>
<remap from="image" to="$(arg depReg_imgrect)"/>
</node>
<!-- Construct point cloud of the rgb and depth topics -->
<node pkg="nodelet" type="nodelet" name="points_xyzrgb" args="load depth_image_proc/point_cloud_xyzrgb standalone_nodelet --no-bond">
<remap from="rgb/camera_info" to="$(arg rgb_camera_info)" />
<remap from="rgb/image_rect_color" to="$(arg rgb_img_rect)"/>
<remap from="depth_registered/image_rect" to="$(arg depReg_imgrect)"/>
<remap from="depth_registered/points" to="$(arg out_cloud)"/>
</node>
<node pkg="tf" type="static_transform_publisher" name="fake_tf" args="0 0 0 0 0 -1.57 odom color 10"/>
<!-- Launch path viewer to visualize odometry -->
<node pkg="path_planning" type="path.py" name="path_pub" output="screen" />
<node pkg="path_planning" type="path_ekf.py" name="path_ekf_pub" output="screen" />
<!-- Creating an Octomap -->
<node pkg="octomap_server" type="octomap_server_node" name="octomap_server">
<param name="resolution" value="0.05"/>
<param name="frame_id" type="string" value="odom" />
<param name="sensor_model/max_range" value="5.0" />
<remap from="cloud_in" to="/realsense/camera/depth_registered/points"/>
</node>
</launch>
And here is the tf tree: frames.pdf
Here is the xacro: LINK
Asked by stevemartin on 2018-09-26 03:28:19 UTC
Comments
Can you also post your xacro file?
Asked by webvenky on 2018-09-28 19:27:17 UTC
@webvenky I have included the description folder.
Asked by stevemartin on 2018-09-29 02:51:25 UTC