Gazebo | Ignition | Community
Ask Your Question

Ignition Gazebo gripper ignores cube collision

asked 2021-12-15 10:36:52 -0600

09ubberboy90 gravatar image


I am using ros foxy with ignition citadel. I am testing ign_ros2_control using panda robot and when I am trying to grip a cube the hand simply goes through it. At the same time this happen there is a huge drop in the real time factor, which I assume is the physics engine detecting a collision and not knowing how to handle it. Is the error due to ros2_control or is it another problem ?

I am using this to spawn panda. The world file is based off this but the same behavior also happen if no world is provided.

<sdf version='1.7'>
  <plugin name='ignition_ros2_control::IgnitionROS2ControlPlugin' filename='ignition_ros2_control-system'>
    <!-- Need to find a way to set this programatically -->

</sdf> I am launching ignition using this launch file

import os

import xacro
from ament_index_python.packages import get_package_share_directory
from launch_ros.actions import Node

from launch import LaunchDescription
from launch.actions import (DeclareLaunchArgument, ExecuteProcess,
from launch.launch_description_sources import PythonLaunchDescriptionSource

def load_file(package_name, file_path):
    package_path = get_package_share_directory(package_name)
    absolute_file_path = os.path.join(package_path, file_path)

        with open(absolute_file_path, 'r') as file:
    except EnvironmentError:  # parent of IOError, OSError *and* WindowsError where available
        return None

def generate_launch_description():
    pkg_name = "simple_arm"
    pkg_ros_ign_gazebo = get_package_share_directory('ros_ign_gazebo')
    pkg_share = get_package_share_directory(pkg_name)

    ignition = IncludeLaunchDescription(
            os.path.join(pkg_ros_ign_gazebo, 'launch', ''),

    spawn = Node(package='ros_ign_gazebo', executable='create',
                    '-name', 'panda',
                    '-x', '0',
                    '-z', '0',
                    '-Y', '0',
                    '-file', os.path.join(pkg_share, "urdf", "panda_ign.sdf",)],

    robot_description_config = xacro.process_file(
    robot_description = {"robot_description": robot_description_config.toxml()}
    robot_state_publisher = Node(

    load_controllers = []
    for controller in [
        load_controllers += [
                    "ros2 control load_controller --set-state start {}".format(controller)],
    return LaunchDescription([
                pkg_share, 'worlds', 'empty.sdf'), " -r"],
            description='Ignition Gazebo arguments'),
    ] + load_controllers

Moveit and rviz are launched using modified launch file from the move_group tutorial and the controller as well as advertizsing the object to rviz is custom made. I have not included them since i do not think they are relevant since all they do is tell moveit which object to move to.

edit retag flag offensive close merge delete


What command interface are you using? AFAIK, you need to use effort because both position and velocity bypass the physics engine. Therefore, neither of these are suitable if you want a controlled model (robot) to interact with other models (objects). Maybe you could get away with velocity command interface if your control frequency is slower than the simulation step size, but I am not sure.

For effort-controlled JTC, see

AndrejOrsula gravatar imageAndrejOrsula ( 2021-12-19 06:23:57 -0600 )edit

I am indeed using position. I tried using a mixed of both position and velocity, which solved the hand going through the cube but i still could't grip. I tried to use the effort controller but even after I built it, moveit still report that it's not implemented. I only have ros-foxy-ros-control installed from binary. Do i need to also install ros-control from source and/or moveit ?

09ubberboy90 gravatar image09ubberboy90 ( 2022-01-06 11:09:25 -0600 )edit

Until the PR is merged, building ros2_controllerswith from source should be enough in order to enable JointTrajectoryController with effort-only command interface. Of course, your version of ros2_control must be compatible with the ros2_controllers that you want to build (as long as ros2_controllers compiles, it should be good).

AndrejOrsula gravatar imageAndrejOrsula ( 2022-01-07 03:07:01 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2022-01-12 10:28:30 -0600

09ubberboy90 gravatar image

updated 2022-01-12 10:28:46 -0600

Thanks to AndrejOrsula's answer. Using an effort controller was indeed the solution. However I used this fork from SC-Robotics instead of his own fork as I am using ros foxy

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2021-12-15 10:36:52 -0600

Seen: 36 times

Last updated: Jan 12