Mapping with kinect instead of Hokuyo laser
- I had a 6 wheeled robot.
- I made mapping using Hokuyo laser and it worked successfully on rviz as shown
- Unfortunately I don't have the Hokuyo laser. I have a kinect. so,I want to make mapping using kinect sensor instead of the Hokuyo laser.
- The most powerful advantage of ros is that being able to reuse code.
- There are famous robots that uses kinect like turtlebot,corobot,pioneer and pi robot.
So,my question is:-
How to add kinect to my model to appear in rviz and gazebo?? What should I modify in my urdf model and .xacro file?? How can I reuse the code of a famous robot for adding kinect to my model and make mapping with kinect ?? Any suggestions ,please??
- This is my_robot.xacro file
<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro"
xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor"
xmlns:controller="http://playerstage.sourceforge.net/gazebo/xmlschema/#controller"
xmlns:interface="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface"
name="robot1_xacro">
<include filename="$(find erratic_description)/urdf/erratic_hokuyo_laser.xacro" />
<!-- BASE LASER ATTACHMENT -->
<erratic_hokuyo_laser parent="base_link">
<origin xyz="0.18 0 0.11" rpy="0 0 0" />
</erratic_hokuyo_laser>
<xacro:property name="length_wheel" value="0.05" />
<xacro:property name="radius_wheel" value="0.05" />
<xacro:macro name="default_inertial" params="mass">
<inertial>
<mass value="${mass}" />
<inertia ixx="1.0" ixy="0.0" ixz="0.0"
iyy="1.0" iyz="0.0"
izz="1.0" />
</inertial>
</xacro:macro>
<link name="base_footprint">
<visual>
<geometry>
<box size="0.001 0.001 0.001"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 0"/>
</visual>
<xacro:default_inertial mass="0.0001"/>
</link>
<gazebo reference="base_footprint">
<material>Gazebo/Green</material>
<turnGravityOff>false</turnGravityOff>
</gazebo>
<joint name="base_footprint_joint" type="fixed">
<origin xyz="0 0 0" />
<parent link="base_footprint" />
<child link="base_link" />
</joint>
<link name="base_link">
<visual>
<geometry>
<box size="0.22 0.380 0.085"/>
</geometry>
<origin rpy="0 0 1.5707" xyz="0 0 0.05"/>
<material name="blue">
<color rgba="0 0 .8 1"/>
</material>
</visual>
<collision>
<geometry>
<box size="0.22 0.380 0.085"/>
</geometry>
</collision>
<xacro:default_inertial mass="10"/>
</link>
<link name="right_wheel_1">
<visual>
<geometry>
<cylinder length="${length_wheel}" radius="${radius_wheel}"/>
</geometry>
<!-- <origin rpy="0 1.57075 0" xyz="-0.085 0.15 -0.25"/> -->
<origin rpy="0 0 0" xyz="0 0 0"/>
<material name="black">
<color rgba="0 0 0 1"/>
</material>
</visual>
<collision>
<geometry>
<cylinder length="${length_wheel}" radius="${radius_wheel}"/>
</geometry>
</collision>
<xacro:default_inertial mass="1"/>
</link>
<link name="right_wheel_2">
<visual>
<geometry>
<cylinder length="${length_wheel}" radius="${radius_wheel}"/>
</geometry>
<!-- <origin rpy="0 1.57075 0" xyz="-0.085 0 -0.25"/> -->
<origin rpy="0 0 0" xyz="0 0 0"/>
<material name="black"/>
</visual>
<collision>
<geometry>
<cylinder length="${length_wheel}" radius="${radius_wheel}"/>
</geometry>
</collision>
<xacro:default_inertial mass="1"/>
</link>
<link name="right_wheel_3">
<visual>
<geometry>
<cylinder length="${length_wheel}" radius="${radius_wheel}"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 0"/>
<material name="black"/>
</visual>
<collision>
<geometry>
<cylinder length="${length_wheel}" radius="${radius_wheel}"/>
</geometry>
</collision>
<xacro:default_inertial mass="1"/>
</link ...