Robotics StackExchange | Archived questions

Gzserver franka_hw_sim assertion failed with dingo

Hi Everyone, I am using Ubuntu 20.04 with Ros Noetic. I am using nVidia GTX 1660 Ti with 418 driver.

I am trying to create a gazebo simulation with Clearpath dingo robot and panda franka emika packages (https://github.com/dingo-cpr/dingo noetic-devel branch and https://github.com/frankaemika/franka_ros/tree/noetic-devel) but I am not able to deal with an error which made gazebo crash. But I am convinced that error is relevant to both packages together, not gazebo itself.

Launch file:

<launch>
  <!-- node for platform -->
  <arg name="config" default="$(optenv DINGO_CONFIG front_laser)" />
  <arg name="use_sim_time" default="true" />
  <arg name="gui" default="true" />
  <arg name="headless" default="false" />
  <arg name="world_name" default="$(find gazebo_ros)/worlds/empty_world.world" />
  <arg name="arm_id" default="panda"/>
  <arg name="arm_namespace" default="panda"/>
  <!-- <arg name="x"         default="0"/>
  <arg name="y"         default="0"/>
  <arg name="z"         default="0.1"/>
  <arg name="yaw"       default="0"/> -->

  <!-- <rosparam command="load" file="$(find dingo_gazebo)/config/control_omni.yaml" /> -->

  <param name="robot_description"
    command="$(find dingo_description)/scripts/env_run
    $(find dingo_description)/urdf/configs/$(arg config)
    $(find xacro)/xacro $(find mobile-platform)/urdf/mobile-platform.urdf.xacro" />

  <rosparam file="$(find franka_gazebo)/config/franka_hw_sim.yaml" subst_value="true" />
  <rosparam file="$(find franka_gazebo)/config/sim_controllers.yaml" subst_value="true" />
  <rosparam command="load" file="$(find dingo_gazebo)/config/gains_omni.yaml"/>

  <param name="m_ee" value="0.76" />  

  <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" /> 
  <node name="joint_state_publisher" type="joint_state_publisher" pkg="joint_state_publisher">
    <rosparam param="source_list">[franka_state_controller/joint_states, franka_gripper/joint_states] </rosparam>
    <param name="rate" value="30"/>
  </node>  



  <node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model"
        args="-urdf -model mobile_platform -param robot_description" />
  <include file="$(find gazebo_ros)/launch/empty_world.launch">
      <arg name="debug" value="0" />
      <arg name="gui" value="$(arg gui)" />
      <arg name="use_sim_time" value="$(arg use_sim_time)" />
      <arg name="headless" value="$(arg headless)" />
      <arg name="world_name" value="$(arg world_name)" />
      <arg name="paused" value="false"/>
  </include>
</launch>

Xacro file which I am using

<?xml version="1.0"?>
<robot name="mobile_platform" xmlns:xacro="http://www.ros.org/wiki/xacro">
  <xacro:include filename="$(find dingo_description)/urdf/dingo.urdf.xacro"/>
  <xacro:include filename="$(find franka_description)/robots/panda/panda.urdf.xacro"/>
</robot>

The errors which I got when launching this file

gzserver: /home/marabir/catkin_ws/src/human-assistant/src/franka_ros/franka_gazebo/src/franka_hw_sim.cpp:215: virtual bool franka_gazebo::FrankaHWSim::initSim(const string&, ros::NodeHandle, gazebo::physics::ModelPtr, const urdf::Model*, std::vector<transmission_interface::TransmissionInfo>): Assertion `this->vji_.getNames().size() == 7' failed.
[spawn_urdf-4] process has finished cleanly

log file: /home/marabir/.ros/log/7507e654-7b38-11ed-a8fe-4bc19181c641/spawn_urdf-4*.log
Aborted (core dumped)

[gazebo-5] process has died [pid 21750, exit code 134, cmd /home/marabir/catkin_ws/src/gazebo_ros_pkgs/gazebo_ros/scripts/gzserver -e ode /home/marabir/catkin_ws/src/gazebo_ros_pkgs/gazebo_ros/worlds/empty_world.world __name:=gazebo __log:=/home/marabir/.ros/log/7507e654-7b38-11ed-a8fe-4bc19181c641/gazebo-5.log].

I am able to launch gazebo with my file while including in xacro robots separately, but both robots seem to work in one workspace and code for registering the hardware joints sees that there are more joints than panda's 7.

The code, which is responsible for that is in file frankahwsim.cpp in line 212

  // After all handles have been assigned to interfaces, register them
  assert(this->eji_.getNames().size() >= 7);
  assert(this->pji_.getNames().size() == 7);
  assert(this->vji_.getNames().size() == 7);
  assert(this->jsi_.getNames().size() >= 7);
  assert(this->fsi_.getNames().size() == 1);
  assert(this->fmi_.getNames().size() == 1);

but I am not sure how can I interfere with this code to not mess everything up, because it should work only for defined panda hardware joints. Dingo and its four wheels should not be involved, but it seems that they are found by this code and exception make the gazebo crash. Both robots work fine alone, but I am not able to make them work as one. I think, that dingo joints are recognized as parts of the panda arm and frankahwsim.cpp tries to check if there are no more than 7 joints and gives an error. Could I somehow split both robots in separate namespaces to prevent things like that from happening?

I would be very happy if someone could give me a hint, how could I finally make the simulation successful.

Asked by Marabir on 2022-12-13 18:41:36 UTC

Comments

Answers