Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

adding two robots in gazebo

I want to add two robots in gazebo.

The first robot is a quadrotor from hector package the second robot is husky

I used apt-get to download both of then except the husky_description. I used git clone "link"

I changed in the mesh file of the husky.

My launch file is the following:

 <launch><!-- Start Gazebo with my world by changing the arg > running in (max) realtime -->
 <include file="$(find haptic_teleoperation)/launch/box.launch"/>
 <!-- Spawn simulated quadrotor uav -->
 <include file="$(find hector_quadrotor_gazebo)/launch/spawn_quadrotor.launch"> 
 <arg name="x" value="10.0"/>
 <arg name="y" value="0.0"/>
 <arg name="z" value="0.3"/>
 <arg name="model" value="$(find hector_quadrotor_description)/urd/quadrotor_hokuyo_utm30lx.gazebo.xacro"/>
 </include>
<include file="$(find haptic_teleoperation)/launch/husky_spawn.launch"/>  
    </launch>

The husky_spwan.launch file is the following:

    <launch>
<!-- Send the Husky A200 Robot URDF/XACRO to param server -->
<param name="robot_description" command="$(find xacro)/xacro.py '$(find husky_description)/urdf/base.urdf.xacro'" />
    <!-- Spawn robot in gazebo -->
    <node name="spawn_husky_model" pkg="gazebo_ros" type="spawn_model" args="$(optenv ROBOT_INITIAL_POSE) -unpause -urdf -param robot_description -model mobile_base"/>

     <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher">
    <param name="publish_frequency" type="double" value="30.0" />

    <!--<remap from="robot_description" to="different_robot_description" />
          <remap from="joint_states" to="different_joint_states" /> -->
</node>

</launch>

the box.launch file only launch the gazebo client and server.

first I faced a problem becasue both robots have two links with the smae names. Therefore, I changed in the urdf file of the husky from base_footprint to husky_foot_print and from base_link into husky_base link. ( I dont know if what I did it write or wrong)

Anyway, when I run the quad rotor alone and I check the tf I find all the tfs and links and joints that are specified in the urdf file for the quad rotor. Also, when I run the husky alone I find all its links and joints.

but when I run them together as the shown in the launch file above the links that their parent is the "base_link" in the quadrotor disapear from the tf tree.

Also, I dont know what is the fixed frame for the husky or from where to spasify it ?? if I want it to be the eorld frame as for the quad rotor what should I do ??

Also, there is a node that is called robot_state_publisher >> should I call it twice for each robot or once for both ?? because it exist in the lauch file of the hector_quadrotor and also you can see it in the launch file for the husky ??

adding two robots in gazebo

I want to add two robots in gazebo.

The first robot is a quadrotor from hector package the second robot is husky

I used apt-get to download both of then except the husky_description. I used git clone "link"

I changed in the mesh file of the husky.

My launch file is the following:

 <launch><!-- Start Gazebo with my world by changing the arg > running in (max) realtime -->
 <include file="$(find haptic_teleoperation)/launch/box.launch"/>
 <!-- Spawn simulated quadrotor uav -->
 <include file="$(find hector_quadrotor_gazebo)/launch/spawn_quadrotor.launch"> 
 <arg name="x" value="10.0"/>
 <arg name="y" value="0.0"/>
 <arg name="z" value="0.3"/>
 <arg name="model" value="$(find hector_quadrotor_description)/urd/quadrotor_hokuyo_utm30lx.gazebo.xacro"/>
 </include>
<include file="$(find haptic_teleoperation)/launch/husky_spawn.launch"/>  
    </launch>

The husky_spwan.launch file is the following:

    <launch>
<!-- Send the Husky A200 Robot URDF/XACRO to param server -->
<param name="robot_description" command="$(find xacro)/xacro.py '$(find husky_description)/urdf/base.urdf.xacro'" />
    <!-- Spawn robot in gazebo -->
    <node name="spawn_husky_model" pkg="gazebo_ros" type="spawn_model" args="$(optenv ROBOT_INITIAL_POSE) -unpause -urdf -param robot_description -model mobile_base"/>

     <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher">
    <param name="publish_frequency" type="double" value="30.0" />

    <!--<remap from="robot_description" to="different_robot_description" />
          <remap from="joint_states" to="different_joint_states" /> -->
</node>

</launch>

the box.launch file only launch the gazebo client and server.

first I faced a problem becasue both robots have two links with the smae names. Therefore, I changed in the urdf file of the husky from base_footprint to husky_foot_print and from base_link into husky_base link. ( I dont know if what I did it write or wrong)

Anyway, when I run the quad rotor alone and I check the tf I find all the tfs and links and joints that are specified in the urdf file for the quad rotor. Also, when I run the husky alone I find all its links and joints.

but when I run them together as the shown in the launch file above the links that their parent is the "base_link" in the quadrotor disapear from the tf tree.

Also, I dont know what is the fixed frame for the husky or from where to spasify it ?? if I want it to be the eorld frame as for the quad rotor what should I do ??

Also, there is a node that is called robot_state_publisher >> should I call it twice for each robot or once for both ?? because it exist in the lauch file of the hector_quadrotor and also you can see it in the launch file for the husky ??

adding Adding two robots in gazebogazebo tfs problem and urdf files

I want to add two robots in gazebo.

The first robot is a quadrotor from hector package the second robot is husky

I used apt-get to download both of then except the husky_description. I used git clone "link"

I changed in the mesh file of the husky.

My launch file is the following:

 <launch><!-- Start Gazebo with my world by changing the arg > running in (max) realtime -->
 <include file="$(find haptic_teleoperation)/launch/box.launch"/>
 <!-- Spawn simulated quadrotor uav -->
 <include file="$(find hector_quadrotor_gazebo)/launch/spawn_quadrotor.launch"> 
 <arg name="x" value="10.0"/>
 <arg name="y" value="0.0"/>
 <arg name="z" value="0.3"/>
 <arg name="model" value="$(find hector_quadrotor_description)/urd/quadrotor_hokuyo_utm30lx.gazebo.xacro"/>
 </include>
<include file="$(find haptic_teleoperation)/launch/husky_spawn.launch"/>  
    </launch>

The husky_spwan.launch file is the following:

    <launch>
<!-- Send the Husky A200 Robot URDF/XACRO to param server -->
<param name="robot_description" command="$(find xacro)/xacro.py '$(find husky_description)/urdf/base.urdf.xacro'" />
    <!-- Spawn robot in gazebo -->
    <node name="spawn_husky_model" pkg="gazebo_ros" type="spawn_model" args="$(optenv ROBOT_INITIAL_POSE) -unpause -urdf -param robot_description -model mobile_base"/>

     <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher">
    <param name="publish_frequency" type="double" value="30.0" />

    <!--<remap from="robot_description" to="different_robot_description" />
          <remap from="joint_states" to="different_joint_states" /> -->
</node>

</launch>

the box.launch file only launch the gazebo client and server.

first I faced a problem becasue both robots have two links with the smae names. Therefore, I changed in the urdf file of the husky from base_footprint to husky_foot_print and from base_link into husky_base link. ( I dont know if what I did it write or wrong)

Anyway, when I run the quad rotor alone and I check the tf I find all the tfs and links and joints that are specified in the urdf file for the quad rotor. Also, when I run the husky alone I find all its links and joints.

but when I run them together as the shown in the launch file above the links that their parent is the "base_link" in the quadrotor disapear from the tf tree.

Also, I dont know what is the fixed frame for the husky or from where to spasify spacey it ?? if I want it to be the eorld world frame as for the quad rotor what should I do ??

Also, there is a node that is called robot_state_publisher >> should I call it twice for each robot or once for both ?? because it exist in the lauch launch file of the hector_quadrotor and also you can see it in the launch file for the husky ??

Actually I could not run if the two robot_state_publisher nodes so I had the following: This node I added it in the launch file of husky:

 <node pkg="robot_state_publisher" type="robot_state_publisher" name="husky_state_publisher"></node>

this node exist in the launch file of the quadrotor:

 <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher"></node>

Adding two robots in gazebo tfs problem and urdf files

I want to add two robots in gazebo.

The first robot is a quadrotor from hector package the second robot is husky

I used apt-get to download both of then except the husky_description. I used git clone "link"

I changed in the mesh file of the husky.

My launch file is the following:

 <launch><!-- Start Gazebo with my world by changing the arg > running in (max) realtime -->
 <include file="$(find haptic_teleoperation)/launch/box.launch"/>
 <!-- Spawn simulated quadrotor uav -->
 <include file="$(find hector_quadrotor_gazebo)/launch/spawn_quadrotor.launch"> 
 <arg name="x" value="10.0"/>
 <arg name="y" value="0.0"/>
 <arg name="z" value="0.3"/>
 <arg name="model" value="$(find hector_quadrotor_description)/urd/quadrotor_hokuyo_utm30lx.gazebo.xacro"/>
 </include>
<include file="$(find haptic_teleoperation)/launch/husky_spawn.launch"/>  
    </launch>

The husky_spwan.launch file is the following:

 

<launch> <!-- Send the Husky A200 Robot URDF/XACRO to param server --> <param name="robot_description" command="$(find xacro)/xacro.py '$(find husky_description)/urdf/base.urdf.xacro'" /> <!-- Spawn robot in gazebo --> <node name="spawn_husky_model" pkg="gazebo_ros" type="spawn_model" args="$(optenv ROBOT_INITIAL_POSE) -unpause -urdf -param robot_description husky_robot_description -model mobile_base"/> mobile_base"/>

<node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher">
name="husky_state_publisher">
    <param name="publish_frequency" type="double" value="30.0" />

    <!--<remap <!--   <remap from="robot_description" to="different_robot_description" />
         <remap from="joint_states" to="different_joint_states" /> -->
/>-->
 </node>

   <node pkg="robot_pose_ekf" type="robot_pose_ekf" name="robot_pose_ekf">
     <rosparam>
      freq: 10.0
      sensor_timeout: 1.0
       publish_tf: true
      odom_used: true
      vo_used: true
      output_frame: /world
     </rosparam>
    </node>
</launch>

</launch>

the box.launch file only launch the gazebo client and server.

first I faced a problem becasue both robots have two links with the smae names. Therefore, I changed in the urdf file of the husky from base_footprint to husky_foot_print and from base_link into husky_base link. ( I dont know if what I did it write or wrong)

Anyway, when I run the quad rotor alone and I check the tf I find all the tfs and links and joints that are specified in the urdf file for the quad rotor. Also, when I run the husky alone I find all its links and joints.

but when I run them together as the shown in the launch file above the links that their parent is the "base_link" in the quadrotor disapear from the tf tree.

Also, I dont know what is the fixed frame for the husky or from where to spacey it ?? if I want it to be the world frame as for the quad rotor what should I do ??

Also, there is a node that is called robot_state_publisher >> should I call it twice for each robot or once for both ?? because it exist in the launch file of the hector_quadrotor and also you can see it in the launch file for the husky ??

Actually I could not run if the two robot_state_publisher nodes so I had the following: This node I added it in the launch file of husky:

 <node pkg="robot_state_publisher" type="robot_state_publisher" name="husky_state_publisher"></node>

this node exist in the launch file of the quadrotor:

 <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher"></node>

Adding two robots in gazebo tfs problem and urdf files

I want to add two robots in gazebo.

The first robot is a quadrotor from hector package the second robot is husky

I used apt-get to download both of then except the husky_description. I used git clone "link"

I changed in the mesh file of the husky.

My launch file is the following:

 <launch><!-- Start Gazebo with my world by changing the arg > running in (max) realtime -->
 <include file="$(find haptic_teleoperation)/launch/box.launch"/>
 <!-- Spawn simulated quadrotor uav -->
 <include file="$(find hector_quadrotor_gazebo)/launch/spawn_quadrotor.launch"> 
 <arg name="x" value="10.0"/>
 <arg name="y" value="0.0"/>
 <arg name="z" value="0.3"/>
 <arg name="model" value="$(find hector_quadrotor_description)/urd/quadrotor_hokuyo_utm30lx.gazebo.xacro"/>
 </include>
<include file="$(find haptic_teleoperation)/launch/husky_spawn.launch"/>  
    </launch>

The husky_spwan.launch file is the following:

 <launch>
  <!-- Send the Husky A200 Robot URDF/XACRO to param server -->
<param name="husky_robot_description" command="$(find xacro)/xacro.py '$(find husky_description)/urdf/base.urdf.xacro'" />
    <!-- Spawn robot in gazebo -->
     <node name="spawn_husky_model" pkg="gazebo_ros" type="spawn_model" args="$(optenv ROBOT_INITIAL_POSE) -unpause -urdf -param husky_robot_description -model mobile_base"/>

mobile_base"/>

<node pkg="robot_state_publisher" type="robot_state_publisher" name="husky_state_publisher">
    <param name="publish_frequency" type="double" value="30.0" />

 <!--   <remap from="robot_description" to="different_robot_description" />
        <remap from="joint_states" to="different_joint_states" />-->
 </node>

   <node pkg="robot_pose_ekf" type="robot_pose_ekf" name="robot_pose_ekf">
     <rosparam>
      freq: 10.0
      sensor_timeout: 1.0
       publish_tf: true
      odom_used: true
      vo_used: true
      output_frame: /world
     </rosparam>
    </node>
</launch>

the box.launch file only launch the gazebo client and server.

first I faced a problem becasue both robots have two links with the smae names. Therefore, I changed in the urdf file of the husky from base_footprint to husky_foot_print and from base_link into husky_base link. ( I dont know if what I did it write or wrong)

Anyway, when I run the quad rotor alone and I check the tf I find all the tfs and links and joints that are specified in the urdf file for the quad rotor. Also, when I run the husky alone I find all its links and joints.

but when I run them together as the shown in the launch file above the links that their parent is the "base_link" in the quadrotor disapear from the tf tree.

Also, I dont know what is the fixed frame for the husky or from where to spacey it ?? if I want it to be the world frame as for the quad rotor what should I do ??

Also, there is a node that is called robot_state_publisher >> should I call it twice for each robot or once for both ?? because it exist in the launch file of the hector_quadrotor and also you can see it in the launch file for the husky ??

Actually I could not run if the two robot_state_publisher nodes so I had the following: This node I added it in the launch file of husky:

 <node pkg="robot_state_publisher" type="robot_state_publisher" name="husky_state_publisher"></node>

this node exist in the launch file of the quadrotor:

 <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher"></node>