Gazebo | Ignition | Community
Ask Your Question

sana's profile - activity

2022-08-05 08:54:21 -0500 received badge  Famous Question (source)
2022-08-05 08:54:21 -0500 received badge  Notable Question (source)
2022-07-13 13:17:59 -0500 received badge  Famous Question (source)
2022-07-13 13:17:59 -0500 received badge  Notable Question (source)
2022-01-01 06:52:58 -0500 received badge  Notable Question (source)
2022-01-01 06:52:58 -0500 received badge  Popular Question (source)
2021-06-24 14:19:02 -0500 received badge  Famous Question (source)
2021-06-24 14:19:02 -0500 received badge  Notable Question (source)
2021-06-18 15:04:32 -0500 received badge  Famous Question (source)
2021-01-29 09:31:40 -0500 received badge  Notable Question (source)
2021-01-21 04:18:06 -0500 received badge  Popular Question (source)
2021-01-21 04:17:38 -0500 received badge  Notable Question (source)
2021-01-21 04:17:38 -0500 received badge  Popular Question (source)
2020-12-04 04:27:49 -0500 marked best answer Empty cylinder geometry for gazebo

Hello, I want to create a hollow (empty) cylinder on Gazebo. I did not find reference to get this forme / geometry. I see that only full cylinder is proposed in gazebo. I have also seen the following link but not found hallow ( empty) cylinder.:

http://sdformat.org/spec?ver=1.7&elem...

Would you please help me creating it? Thank you

2020-12-04 04:27:01 -0500 asked a question Collision between only some elements of one model

Collision between only some elements of one model I want to know please how can I turn on collision between only some el

2020-11-23 21:32:49 -0500 received badge  Popular Question (source)
2020-11-20 03:29:29 -0500 edited question Gazebo simulation of a suspended robot / control and gravity problem

Gazebo simulation of a suspended robot / control and gravity problem Hello everyone, I am trying to simulate the robot

2020-11-20 03:28:17 -0500 asked a question Gazebo simulation of a suspended robot / control and gravity problem

Gazebo simulation of a suspended robot / control and gravity problem Hello everyone, I am trying to simulate the robot

2020-11-19 02:43:26 -0500 edited question Empty cylinder geometry for gazebo

Empty cylinder geometry for gazebo Hello, I want to create a hollow (empty) cylinder on Gazebo. I did not find referenc

2020-11-18 15:20:39 -0500 received badge  Student (source)
2020-11-18 09:11:58 -0500 edited question Empty cylinder geometry for gazebo

Hallow cylinder geometry for gazebo Hello, I want to create a hallow (empty) cylinder on Gazebo. I did not find referen

2020-11-18 09:11:42 -0500 asked a question Empty cylinder geometry for gazebo

Hallow cylinder geometry for gazebo Hello, I want to create a hallow (empty) cylinder on Gazebo. I did not find referen

2020-11-16 08:05:48 -0500 edited question gravity not disabled while <gravity>0</gravity>

gravity not disabled while <gravity>0</gravity> Hello, I added the tag <gravity>0</gravity>

2020-11-16 05:11:39 -0500 asked a question gravity not disabled while <gravity>0</gravity>

gravity not disabled while <gravity>0</gravity> Hello, I added the tag <gravity>0</gravity>

2020-11-12 02:30:27 -0500 commented answer angle_0 in joints gazebo

Thank you! You have reason. angle_0 displays the actual joint position in gazebo (radian).

2020-11-12 02:30:01 -0500 answered a question angle_0 in joints gazebo

Thank you! You have reason. angle_0 displays the actual joint position in gazebo (radian).

2020-11-12 02:28:44 -0500 marked best answer angle_0 in joints gazebo

I want to know please what does angle_0 present in joint description in gazebo?? Is it an offset? Where is it defined? and how to modify it? Thank you very much

C:\fakepath\Capture du 2020-11-06 15-58-56.png

2020-11-12 02:28:18 -0500 received badge  Popular Question (source)
2020-11-06 08:58:20 -0500 received badge  Editor (source)
2020-11-06 08:58:20 -0500 edited question angle_0 in joints gazebo

angle_0 in joints gazebo I want to know please what does angle_0 present in joint description in gazebo?? Is it an offs

2020-11-06 08:57:12 -0500 asked a question angle_0 in joints gazebo

angle_0 in joints gazebo I want to know please what does angle_0 present in joint description in gazebo?? Is it an offs

2020-10-28 10:52:59 -0500 asked a question Modify link color when collision

Modify link color when collision Hello, I would like to know please if there is a way to modify link color during simul

2020-10-28 03:16:01 -0500 received badge  Enthusiast
2020-10-27 08:10:36 -0500 asked a question subscriber to "gazebo_msgs/ContactsState" topic

subscriber to "gazebo_msgs/ContactsState" topic I am trying to write a subscriber to a topic whose type "gazebo_msgs/Con

2020-10-26 11:08:56 -0500 asked a question Version problem of "gazebo_msgs/ContactsState" type

Version problem of "gazebo_msgs/ContactsState" type Hello, I am trying to write a subscriber to a topic /gp8ContactToo

2020-10-22 08:59:21 -0500 received badge  Popular Question (source)
2020-10-22 08:58:37 -0500 received badge  Notable Question (source)
2020-10-16 02:15:21 -0500 commented answer Contact sensor plugin not working

Thank you! I changed my collision name in urdf with respect to the one mentioned in sdf. It works!

2020-10-16 02:14:29 -0500 marked best answer Contact sensor plugin not working

Hello, I am trying to add a contact sensor to my robotic arm tool to be able to detect its collision with external parts. I tried to follow the tutorial proposed here . When I run my gazebo project, I find the desired gazebo topic but It does not display the collisions.

I added the contact sensor to my .urdf as follows:

  <gazebo reference="tool0">
        <sensor name='my_contact' type='contact'>
         <update_rate>10</update_rate>
        <plugin name="my_plugin" filename="libcontact.so"/>
    <contact>
                <collision>tool_collision</collision>
        </contact>
        </sensor>
  </gazebo>

and my plugin is as follows:

ContactPlugin.hh

#ifndef _GAZEBO_CONTACT_PLUGIN_HH_
#define _GAZEBO_CONTACT_PLUGIN_HH_

#include <string>

#include <gazebo/gazebo.hh>
#include <gazebo/sensors/sensors.hh>

namespace gazebo
{
  /// \brief An example plugin for a contact sensor.
  class ContactPlugin : public SensorPlugin
  {
    /// \brief Constructor.
    public: ContactPlugin();

    /// \brief Destructor.
    public: virtual ~ContactPlugin();

    /// \brief Load the sensor plugin.
    /// \param[in] _sensor Pointer to the sensor that loaded this plugin.
    /// \param[in] _sdf SDF element that describes the plugin.
    public: virtual void Load(sensors::SensorPtr _sensor, sdf::ElementPtr _sdf);

    /// \brief Callback that receives the contact sensor's update signal.
    private: virtual void OnUpdate();

    /// \brief Pointer to the contact sensor
    private: sensors::ContactSensorPtr parentSensor;

    /// \brief Connection that maintains a link between the contact sensor's
    /// updated signal and the OnUpdate callback.
    private: event::ConnectionPtr updateConnection;
  };
}
#endif

and

PluginContact.cc

#include "ContactPlugin.hh"
using namespace gazebo;
GZ_REGISTER_SENSOR_PLUGIN(ContactPlugin)

/////////////////////////////////////////////////
ContactPlugin::ContactPlugin() : SensorPlugin()
{
}

/////////////////////////////////////////////////
ContactPlugin::~ContactPlugin()
{
}

/////////////////////////////////////////////////
void ContactPlugin::Load(sensors::SensorPtr _sensor, sdf::ElementPtr /*_sdf*/)
{
  // Get the parent sensor.
  this->parentSensor =
    std::dynamic_pointer_cast<sensors::ContactSensor>(_sensor);

  // Make sure the parent sensor is valid.
  if (!this->parentSensor)
  {
    gzerr << "ContactPlugin requires a ContactSensor.\n";
    return;
  }

  // Connect to the sensor update event.
  this->updateConnection = this->parentSensor->ConnectUpdated(
      std::bind(&ContactPlugin::OnUpdate, this));

  // Make sure the parent sensor is active.
  this->parentSensor->SetActive(true);
}

/////////////////////////////////////////////////
void ContactPlugin::OnUpdate()
{
  // Get all the contacts.
  msgs::Contacts contacts;
  contacts = this->parentSensor->Contacts();
  for (unsigned int i = 0; i < contacts.contact_size(); ++i)
  {
    std::cout << "Collision between[" << contacts.contact(i).collision1()
              << "] and [" << contacts.contact(i).collision2() << "]\n";

    for (unsigned int j = 0; j < contacts.contact(i).position_size(); ++j)
    {
      std::cout << j << "  Position:"
                << contacts.contact(i).position(j).x() << " "
                << contacts.contact(i).position(j).y() << " "
                << contacts.contact(i).position(j).z() << "\n";
      std::cout << "   Normal:"
                << contacts.contact(i).normal(j).x() << " "
                << contacts.contact(i).normal(j).y() << " "
                << contacts.contact(i).normal(j).z() << "\n";
      std::cout << "   Depth:" << contacts.contact(i).depth(j) << "\n";
    }
  }
}

when I reand the target link contact through the command

gz topic -e /gazebo/default/robot/tool0/my_contact/contacts

All what I obtain is info about simulation time. Here an example

time {
  sec: 332
  nsec: 996000000
}

Can you please tell what can be the problem???? I am so thankful

2020-10-16 02:14:29 -0500 received badge  Scholar (source)
2020-10-13 14:31:18 -0500 received badge  Popular Question (source)
2020-10-13 05:50:44 -0500 asked a question Contact sensor plugin not working

Contact sensor plugin not working Hello, I am trying to add a contact sensor to my robotic arm tool to be able to detect

2020-10-12 09:03:45 -0500 asked a question Create a subscriber for gazebo topic /gazebo/default/physics/contacts

Create a subscriber for gazebo topic /gazebo/default/physics/contacts Hello, Can someone please tell me how can I subscr