Rosanswers logo

Hi everyone, I have a turtlebot2, Groovy, Phantomx Pincher arm. I mounted the pincher arm on turtlebot by rewriting file "turtlebot_description/urdf/graveyard/turtlebot.urdf.xacro". But firstly I don't know how to visualise my model(by Rviz), and secondly to grasp things I need to publish TF based on this new model urdf. But after reading turtlebot bringup's minimal.launch I'm confused in how to do it? I didn't found such sentence like , which is beyond my imagine. I appreciate your help if you can teach me how to change the minimal.launch file(or other methods that can get the same outcomes)!

Originally posted by Yantian_Zha on ROS Answers with karma: 74 on 2014-04-21

Post score: 0

Original comments

Comment by Ken_in_JAPAN on 2014-04-21:
I have added hokuyo sensor to turtlebot2 model and have changed position of kinect to on the top plate. In my case, I edited minimal.launch, hexagon.urdf.xacro in /turtlebot_description/urdf/stacks and so on.

Comment by Yantian_Zha on 2014-04-21:
Thanks so much. I know the way to editing .urdf.xacro of certain components, such as your hexagon, but in researching minimal.launch I still don't know where should I edit? Note that the second "include file" points to _robot.launch, should I edit _robot.launch? _robot.launch still confused me.


1 Answer 1


Rosanswers logo

I want you to read this contents as a reference. This might be good answer. I wrote following sentences in minimal.launch

  < arg name="base"       default="$(optenv TURTLEBOT_BASE kobuki)"/ &gt
  &lt arg name="battery"    default="$(optenv TURTLEBOT_BATTERY /sys/class/power_supply/BAT0)"/ >
  < arg name="stacks"     default="$(optenv TURTLEBOT_STACKS hexagons)"/ &gt
  &lt arg name="3d_sensor"  default="$(optenv TURTLEBOT_3D_SENSOR kinect)"/ >
  < arg name="sensor"          default="$(optenv TURTLEBOT_SENSOR hokuyo)"/ &gt </b>
  &lt arg name="simulation" default="$(optenv TURTLEBOT_SIMULATION false)"/ >
  < arg name="tf_prefix" default="" / >

  < param name="/use_sim_time" value="$(arg simulation)"/ >

  < include file="$(find turtlebot_bringup)/launch/includes/robot.launch.xml &gt
    &lt arg name="base" value="$(arg base)" / >
    < arg name="stacks" value="$(arg stacks)" / &gt
&lt arg name="3d_sensor" value="$(arg 3d_sensor)" / >
    < arg name="sensor" value="$(arg sensor)" / >
  < /include >

In turtlebot_bringup/launch/includes/robot.launch.xml, I added two sentences to robot.launch.xml

< launch >
  < arg name="sensor"/ >

< include file="$(find turtlebot_bringup)/launch/includes/description_kobuki.launch.xml" >

  < arg name="sensor" value="$(arg sensor)" / > 
< /include >

In kobuki_description.launch,

< launch >
  < arg name="base"/>
  < arg name="stacks"/>
  < arg name="3d_sensor"/>
  < arg name="sensor"/>
  < arg name="urdf_file" default="$(find xacro)/xacro.py '$(find turtlebot_description)/robots/$(arg base)_$(arg stacks)_$(arg 3d_sensor)_$(arg sensor).urdf.xacro'" />
  < param name="robot_description" command="$(arg urdf_file)" / >
< /launch>

In kobuki_hexagons_kinect_hokuyo.urdf.xacro,

< robot name="turtlebot" xmlns:xacro="http://ros.org/wiki/xacro">

  < xacro:include filename="$(find turtlebot_description)/urdf/turtlebot2_library.urdf.xacro" />
  < kobuki/>
  < stack_hexagons parent="base_link"/>
  < sensor_kinect  parent="plate_top_link"/>
  < sensor_hokuyo parent="plate_middle_link">
</robot >

After that, I just write *.urdf.xacro.

Originally posted by Ken_in_JAPAN with karma: 894 on 2014-04-21

This answer was ACCEPTED on the original site

Post score: 0

Original comments

Comment by Yantian_Zha on 2014-04-22:
It seems that my files are different than yours, but I believe that your answer is helpful. Thanks!

Comment by Ken_in_JAPAN on 2014-04-22:
I'm sorry, I don't have a solution to move an arm. I think that point is difficult. If you solve the problem, I want you to report it. Thanks!


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.