ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

Hey, I dont have your robot's urdf model file so i could't test the solution, I can guide you with basic hack (hope it ll help), any ways Here's the trick,

1)

In your urdf model file, remove <sensor> //hokuyu stuff </sensor> (now here we should put kinnect stuff,and that can be taken from turtlebot urdf) ( b4 that note down the transformations of hokuyu, i.e., xyr rpy of sensor position) locate turtlebot_description folder in your system (easiest way is : $ roscd turtelbot_description), in folder 'urdf/sensor' you will find kinect.urdf.xacro file. copy it to package folder. also locate these files 1) turtlebot_gazebo.urdf.xacro 2) turtlebot_properties.urdf.xacro(mostly in parent directory) and copy it to same package folder (as we dont want to mess up original files).

Changes: in "kinnect" file first change first two <include> files. :

<xacro:include filename="$(find your_package)/turtlebot_gazebo.urdf.xacro"/> <xacro:include filename="$(find your_package)/turtlebot_properties.urdf.xacro"/>

in turtlebot_properties.urdf.xacro file : <property name="cam_px" value="-0.087"/> <property name="cam_py" value="-0.0125"/> <property name="cam_pz" value="0.2870"/> <property name="cam_or" value="0"/> <property name="cam_op" value="0"/> <property name="cam_oy" value="0"/> (sensor position)
Here write corresponding x,y,z value from hokuyu part.

now in your URDF file,

write these lines (instead of older <sensor> part) include our "kinnect" file:

<xacro:include filename="$(find your_package)/kinect.urdf.xacro"/>

<sensor_kinect parent="your_base_link"/>

"Most probably" this should work, as I havent tested it, I cant be sure that this will be compiled without any error. But if you receive any error then, (you know the basic trick so). just track down missing file or parameter in these file and compare it with turtlebot urdf model.

For your second question, your code will work without making any changes(hopefully) if not then list down all the topics published, see where the scan or base_scan has been published and make appropriate changes in your launch file. (you can use remap function to remap one topic to another one).

Hope this will help. Sudeep

Hey, I dont have your robot's urdf model file so i could't test the solution, I can guide you with basic hack (hope it ll help), any ways Here's the trick,

1)

In your urdf model file, remove <sensor> //hokuyu stuff </sensor> (now here we should put kinnect stuff,and that can be taken from turtlebot urdf) ( b4 that note down the transformations of hokuyu, i.e., xyr rpy of sensor position) locate position)

Locate turtlebot_description folder in your system (easiest way is : $ roscd turtelbot_description), in folder 'urdf/sensor' you will find kinect.urdf.xacro file. copy it to package folder. also locate these files 1) turtlebot_gazebo.urdf.xacro 2) turtlebot_properties.urdf.xacro(mostly in parent directory) and copy it to same package folder (as we dont want to mess up original files).

Changes: in "kinnect" file first change first two <include> files. :

<xacro:include filename="$(find your_package)/turtlebot_gazebo.urdf.xacro"/> <xacro:include filename="$(find your_package)/turtlebot_properties.urdf.xacro"/>

in turtlebot_properties.urdf.xacro file : <property name="cam_px" value="-0.087"/> <property name="cam_py" value="-0.0125"/> <property name="cam_pz" value="0.2870"/> <property name="cam_or" value="0"/> <property name="cam_op" value="0"/> <property name="cam_oy" value="0"/> (sensor position)
Here write corresponding x,y,z value from hokuyu part.

now in your URDF file,

write these lines (instead of older <sensor> part) include our "kinnect" file:

<xacro:include filename="$(find your_package)/kinect.urdf.xacro"/>

<sensor_kinect parent="your_base_link"/>

"Most probably" this should work, as I havent tested it, I cant be sure that this will be compiled without any error. But if you receive any error then, (you know the basic trick so). just track down missing file or parameter in these file and compare it with turtlebot urdf model.

For your second question, your code will work without making any changes(hopefully) if not then list down all the topics published, see where the scan or base_scan has been published and make appropriate changes in your launch file. (you can use remap function to remap one topic to another one).

Hope this will help. Sudeep