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

husky spawns successfully but spawn_model node not found

asked 2021-01-28 04:30:54 -0500

updated 2021-01-28 04:39:46 -0500

I am running the husky_empty_world.launch file (see below) inside the husky_gazebo package. Inside this launch file is call to spawn_husky.launch file (see below).

I have this piece of code inside the spawn_husky.launch file -

   <node name="spawn_husky_model" pkg="gazebo_ros" type="spawn_model"
            args="-x $(arg x)
                  -y $(arg y)
                  -z $(arg z)
                  -Y $(arg yaw)
                  -unpause
                  -urdf
                  -param robot_description
                  -model $(arg robot_namespace)" />

But when I launch the husky_empty_world.launch file and run rosnode list in the terminal, I only see the following items -

/base_controller_spawner
/ekf_localization
/gazebo
/gazebo_gui
/joy_teleop/joy_node
/joy_teleop/teleop_twist_joy
/robot_state_publisher
/rosout
/twist_marker_server
/twist_mux

There's no node named spawn_model in this list even though a Husky bot is getting spawned in the Gazebo world. Why is this happening?

husky_empty_world.launch

<?xml version="1.0"?>

<launch>

  <arg name="world_name" default="worlds/empty.world"/>

  <arg name="laser_enabled" default="true"/>
  <arg name="realsense_enabled" default="false"/>

  <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="world_name" value="$(arg world_name)"/> <!-- world_name is wrt GAZEBO_RESOURCE_PATH environment variable -->
    <arg name="paused" value="false"/>
    <arg name="use_sim_time" value="true"/>
    <arg name="gui" value="true"/>
    <arg name="headless" value="false"/>
    <arg name="debug" value="false"/>
  </include>

  <include file="$(find husky_gazebo)/launch/spawn_husky.launch">
    <arg name="laser_enabled" value="$(arg laser_enabled)"/>
    <arg name="realsense_enabled" value="$(arg realsense_enabled)"/>
  </include>

</launch>

spawn_husky.launch

<?xml version="1.0"?>

<launch>

  <arg name="multimaster" default="false"/>

  <arg name="robot_namespace" default="/"/>

  <arg name="x" default="0.0"/>
  <arg name="y" default="0.0"/>
  <arg name="z" default="0.0"/>
  <arg name="yaw" default="0.0"/>

  <arg name="laser_enabled" default="$(optenv HUSKY_LMS1XX_ENABLED false)"/>
  <arg name="realsense_enabled" default="$(optenv HUSKY_REALSENSE_ENABLED false)"/>
  <arg name="urdf_extras" default="$(optenv HUSKY_URDF_EXTRAS)"/>

  <!-- Optionally disable teleop control -->
  <arg name="joystick" default="true" />

  <group ns="$(arg robot_namespace)">

    <group if="$(arg multimaster)">
      <include file="$(find husky_description)/launch/description.launch" >
        <arg name="robot_namespace" value="$(arg robot_namespace)"/>
        <arg name="laser_enabled" default="$(arg laser_enabled)"/>
        <arg name="realsense_enabled" default="$(arg realsense_enabled)"/>
        <arg name="urdf_extras" default="$(arg urdf_extras)"/>
      </include>

      <include file="$(find multimaster_launch)/launch/multimaster_gazebo_robot.launch">
        <arg name="gazebo_interface" value="$(find husky_control)/config/gazebo_interface.yaml" />
        <arg name="robot_namespace" value="$(arg robot_namespace)"/>
      </include>

      <!-- For multimaster bringuplaunch, need to load the controller config -->
      <rosparam command="load" file="$(find husky_control)/config/control.yaml" />
    </group>

    <!-- For single master bringup, run robot control on the gazebo master -->
    <!-- Note that husky_description/description.launch is already included in husky_control/control.launch. -->
    <group unless="$(arg multimaster)">
      <include file="$(find husky_control)/launch/control.launch">
        <arg name="multimaster" value="$(arg multimaster)"/>
        <arg name="laser_enabled" value="$(arg laser_enabled)"/>
        <arg name="realsense_enabled" default="$(arg realsense_enabled)"/>
        <arg name="urdf_extras" value="$(arg urdf_extras)"/>
      </include>
      <include file="$(find husky_control)/launch/teleop.launch">
        <arg name="joystick" value="$(arg joystick)" />
      </include> ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-02-03 03:27:32 -0500

rodrigo55 gravatar image

Hi,

You are not seeing /spawn_model under rosnode list because it is not a normal node, it's actually a small python script that makes a service call to the /gazebo node, so it disappears when it completes its job.

If you need a more in-depth explanation, I made this video that could help:

https://www.youtube.com/watch?v=ZfVOD...

edit flag offensive delete link more

Comments

Thanks!

P.S. - It was very exciting to (sort of) feature on The Construct channel :-P I have been following the channel for quite some time now. Thank you for what you guys do :-)

skpro19 gravatar image skpro19  ( 2021-02-03 13:38:29 -0500 )edit
1

Can you please update your answer with main points from the video? If your video goes down or isn't available for certain regions then your answer/solution isn't as useful. Also, some prefer text to 14+ minute video

jayess gravatar image jayess  ( 2021-03-11 00:07:24 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2021-01-28 04:30:54 -0500

Seen: 451 times

Last updated: Feb 03 '21