Gazebo Actor's collisions and skeleton show up at origin

asked 2021-02-08 04:06:39 -0600

gazela gravatar image

updated 2022-05-28 16:52:26 -0600

lucasw gravatar image


I'm using ROS Melodic (gazebo_ros) and Gazebo 9.0.0 on Ubuntu 18.04 (5.4.0-58-generic).

I've been working with the ActorPlugin. I want the actor to publish his pose to be later detected by the logical camera plugin, so I've changed this->actor->SetWorldPose(pose, false, false); to this->actor->SetWorldPose(pose, true, true); in the This however leads to the following effect: Actor's collisions and skeleton are constantly moving from the correct position to the origin of the coordinate frame and then back. See the images here for illustration.

Without ROS (if I run it directly in Gazebo) the plugin works fine. However, when I include it into a ROS package, the above mentioned problem appears.

Below is the code that I'm using, almost completely copied from ActorPlugin. I've only changed the line I've mentioned above and removed some objects from the world file (+ added files that are needed for a ROS package). Do I need to change anything else to avoid this issue?

Link to the same question asked on Gazebo forum:

File CmakeLists.txt:

cmake_minimum_required(VERSION 3.0.2)

find_package(catkin REQUIRED COMPONENTS

find_package(gazebo REQUIRED)


add_library(CafeActorPlugin src/
target_link_libraries(CafeActorPlugin ${GAZEBO_LIBRARIES})

File package.xml:

<?xml version="1.0"?>
<package format="2">
  <description>The mycafe package</description>

  <maintainer email="gazela@todo.todo">gazela</maintainer>




File launch/mycafe.launch:

  <!-- We resume the logic in empty_world.launch, changing only the name of the world to be launched -->
  <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="world_name" default="$(find mycafe)/worlds/"/>
    <arg name="paused" value="false"/>
    <arg name="use_sim_time" value="true"/>
    <arg name="gui" value="true"/>
    <arg name="recording" value="false"/>
    <arg name="debug" value="false"/>
    <arg name="verbose" value="true"/>

File worlds/

<!-- Usage notes are located in this file, look for "Usage"-->
<?xml version="1.0" ?>
<sdf version="1.5">
  <world name="default">

    <actor name="actor1">
      <pose>0 1 1.25 0 0 0</pose>
      <animation name="walking">

      <plugin name="actor1_plugin" filename="">
        <target>0 -5 1.2138</target>
        <!-- Usage: Modify the set of models that the vector field should
             ignore when moving the actor -->


File src/

#include "CafeActorPlugin.hh"

#include <functional>
#include <ignition/math.hh>

#include "gazebo/physics/physics.hh"

using namespace gazebo ...
edit retag flag offensive close merge delete