Actor's collisions and skeleton show up at origin

asked 2021-02-03 10:04:10 -0600

gazela gravatar image

updated 2021-02-09 06:39:30 -0600


I'm using Gazebo 9.0.0 on Ubuntu 18.04. I'm also using gazebo_ros (ROS Melodic).

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 for illustration:

image description

image description

I created a ROS package. 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. Do I need to change anything else to avoid this issue?

Link to the same question asked on the ROS 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;

#define WALKING_ANIMATION "walking"


void CafeActorPlugin::Load(physics::ModelPtr _model, sdf::ElementPtr _sdf)
  this->sdf = _sdf;
  this->actor = boost::dynamic_pointer_cast<physics::Actor>(_model);
  this->world = this->actor->GetWorld();

      std ...
edit retag flag offensive close merge delete