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

Unable to get Rviz to display robot

asked 2022-05-29 09:10:23 -0500

lutinplunder gravatar image

I have been working on a robot of my own design and I have it working with hardware but when I try to visualize it in Rviz it's not working. code repository

When I run the display.launch the robot displays correctly.

    name="model" />
    default="true" />
    textfile="$(find shelob_syropod)/robot/shelob_syropod.urdf" />
    value="$(arg gui)" />
    type="joint_state_publisher" />
    type="robot_state_publisher" />
    args="-d $(find shelob_syropod)/rviz/urdf.rviz" />

However when I use the shelob_highlevel.launch.

<!-- -*- xml -*- -->


  <!-- Define ancillary node launch arguments -->
  <arg name="syropod" default="shelob" />
  <arg name="config" default="shelob" />
  <arg name="gait" default="gait" />
  <arg name="auto_pose" default="auto_pose" />
  <arg name="control" default="joy" />
  <arg name="rviz" default="true" />
  <arg name="gazebo" default="false" />
  <arg name="plot" default="false" />
  <arg name="reconfigure" default="false" />
  <arg name="logging" default="false" />

  <!-- Set package name -->
  <arg name="package" value="(find $(arg syropod)_syropod)" />

  <!-- Control method (joypad or keyboard)-->
  <node if="$(eval control == 'joy')" pkg="joy" type="joy_node" name="joystick"/>
  <rosparam if="$(eval control == 'key')" file="$(find syropod_keyboard_control)/config/dell_key_map.yaml" command="load"/>
  <node if="$(eval control == 'key')" pkg="syropod_keyboard_control" type="syropod_keyboard_control_node" name="key" output="screen"/>
  <node if="$(eval control == 'rqt')" pkg="syropod_rqt_reconfigure_control" type="syropod_rqt_reconfigure_control" name="rqt_control" output="screen"/>
  <node if="$(eval control == 'rqt')" pkg="rqt_reconfigure" type="rqt_reconfigure" name="rqt_reconfigure" output="screen"/>

  <!-- Remote Start-->
  <node if="$(eval arg('control') not in ('rqt'))" pkg="syropod_remote" type="syropod_remote" name="syropod_remote" output="screen">
    <param name="publish_rate" value="10"/>
    <param name="imu_sensitivity" value="3"/>
    <param name="invert_compass" value="true"/>
    <param name="invert_imu" value="true"/>

  <!-- Highlevel controller related parameters -->
  <rosparam file="$$(arg package)/config/$(arg gait).yaml" command="load"/>
  <rosparam file="$$(arg package)/config/$(arg auto_pose).yaml" command="load"/>
  <rosparam file="$$(arg package)/config/$(arg config).yaml" command="load"/>

  <!-- Highlevel Controller Start -->
  <node name="shc" pkg="syropod_highlevel_controller" type="syropod_highlevel_controller_node" output="screen" />

  <!-- Launch RVIZ with default SHC config -->
  <group if="$(arg rviz)">
    <param name="/syropod/parameters/debug_rviz" value="true"/>
            textfile="$(find shelob_syropod)/robot/shelob_syropod.urdf" />
    <node name="rviz" pkg="rviz" type="rviz" args="-d $(find syropod_highlevel_controller)/rviz_cfg/shelob_SHC_display.rviz"/>

  <!-- Launch Gazebo Simulation -->
  <group if="$(arg gazebo)">
    <param name="/syropod/parameters/individual_control_interface" value="true"/>
    <include file="$$(arg package)/launch/$(arg syropod)_gazebo.launch"/>

  <!-- Launch ancillary nodes if requested -->
  <node if="$(arg plot)" name="rqt_plot" pkg="rqt_plot" type="rqt_plot"/>
  <node if="$(arg reconfigure)" name="reconfigure" pkg="rqt_reconfigure" type="rqt_reconfigure"/>

  <!-- Logging -->
  <group if="$(arg logging)">
    <include file="$$(arg package)/launch/$(arg syropod)_log.launch">
      <arg name="bagfile_name" value ...
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2022-05-29 19:35:47 -0500

lutinplunder gravatar image

I figured it out. I needed to launch Rviz with Gazebo in order to load the controllers, use sim time and update the python code for the controllers to use python3. I'm still having a problem with the controllers loading with the .launch but I can use RQT to load them after Gazebo starts.

edit flag offensive delete link more


If you've answered your own question, please accept your own answer by clicking the grey check mark on the left.

Joe28965 gravatar image Joe28965  ( 2022-05-30 01:31:21 -0500 )edit

Question Tools



Asked: 2022-05-29 09:10:23 -0500

Seen: 190 times

Last updated: May 29 '22