Gazebo | Ignition | Community
Ask Your Question

Chris's profile - activity

2016-03-20 04:46:39 -0600 received badge  Nice Answer (source)
2015-10-31 12:30:26 -0600 marked best answer model plugin doesn't receive data from a subscribed topic

Hey,

I have a problem and I think it comes from a stupid mistake, but I am not able to find it.

I have a world and a model plugin and data has to be exchanged. So I use the message system to send and receive messages. It works fine, both plugins are loaded and the model plugin sends a message to the world plugin. The data is received and the world plugin sends some data back. But the callback-function of the model plugin is never called.

Can you take a quick look and tell me what I did wrong? Here is the code code

2015-10-31 12:30:16 -0600 marked best answer Sensor Pose is wrong

Hi,

I am having trouble with ray sensors and their pose in gazebo 1.4. The pose of links can be handled like I want them to behave. So I fixed my problem by using an extra link for each sensor until now.

 <link name="link_sensor1">
    <pose>0.0 0.0 0.51 0.0 0.0 0.0</pose>
    <sensor name="raysensor" type="ray">
     <always_on>true</always_on>
     <visualize>true</visualize>
     <ray>
      <!--...-->
     </ray>
    </sensor>
  </link>
  <link name="link_sensor2">
    <pose>0.0 0.0 0.51 0.0 -1.57 0.0 </pose>
    <sensor name="raysensor2" type="ray">
      <always_on>true</always_on>
      <visualize>true</visualize>
      <ray>
       <!--...-->
      </ray>
    </sensor>
  </link>

Now I want to add all the sensors to one link, to have an easier control via joints (I don't want to add a seperate joint for each sensor)

The model:

<model name="box">
  <pose>0 0 0.5 0 0 0</pose>
  <static>false</static>
  <link name="link">
    <inertial>
      <mass>1.0</mass>
      <inertia>
        <ixx>1.0</ixx>
        <ixy>0.0</ixy>
        <ixz>0.0</ixz>
        <iyy>1.0</iyy>
        <iyz>0.0</iyz>
        <izz>1.0</izz>
      </inertia>
    </inertial>
    <collision name="collision">
      <geometry>
        <box>
          <size>1 1 1</size>
        </box>
      </geometry>
     </collision>
    <visual name="collision">
      <geometry>
        <box>
          <size>1 1 1</size>
        </box>
      </geometry>
    </visual>
  </link>
  <link name="link2">
    <sensor name="raysensor" type="ray">
      <always_on>true</always_on>
      <visualize>true</visualize>
      <pose>0.0 0.0 0.51 0.0 0.0 0.0</pose>
      <ray>
        ...
      </ray>
    </sensor>
    <sensor name="raysensor2" type="ray">
      <always_on>true</always_on>
      <visualize>true</visualize>
      <pose>0.0 0.0 0.51 0.0 -1.57 0.0 </pose>
      <ray>
       ...
      </ray>
    </sensor>
  </link>
  <joint name="my_joint" type="revolute">
    <parent>link</parent>
    <child>link2</child>
    <axis>
      <xyz>0 0 1</xyz>
    </axis>
  </joint>
</model>

In gazebo there is the following result: image description

I don't get any rotation done correctly... What am I doing wrong? Can anyone help me please...

2015-10-31 12:26:40 -0600 marked best answer Model Plugin does not load

Hey guys,

I am trying to do the following:

run a world with a world plugin -> world plugin creates a model (also with plugin). If I create a sensor with a sensor plugin (dynamically with the world plugin) then the sensor plugin is loaded. The model plugin is not...

I tried multiple versions of gazebo (1.4, 1.6, 1.9). Can you give me a hint?

Here are some code snippets: pastebin

2015-06-19 04:28:19 -0600 received badge  Famous Question (source)
2014-09-05 06:50:37 -0600 received badge  Notable Question (source)
2014-09-05 06:49:45 -0600 received badge  Famous Question (source)
2014-08-03 04:41:17 -0600 received badge  Taxonomist
2014-05-26 08:07:10 -0600 received badge  Famous Question (source)
2014-04-09 12:20:14 -0600 received badge  Famous Question (source)
2014-02-10 15:39:41 -0600 received badge  Notable Question (source)
2014-01-17 11:57:12 -0600 received badge  Popular Question (source)
2013-11-08 07:48:29 -0600 received badge  Notable Question (source)
2013-11-07 07:02:21 -0600 received badge  Famous Question (source)
2013-08-06 07:23:12 -0600 received badge  Notable Question (source)
2013-08-05 03:58:19 -0600 commented question Driving a simple robot model (1.5 Building a Robot with SDF Tutorial)

<plugin name="differentialdrivecontroller" filename="libmyrobotdiffdrive.so"> <alwaysOn><tr> </tr>ue</alwaysOn> Maybe this is the problem?

2013-08-02 03:25:47 -0600 received badge  Teacher (source)
2013-08-02 03:24:18 -0600 commented answer is there any distance measuring sensor in gazebo ?

No problem. If you have further questions, let me know

2013-08-02 02:50:28 -0600 answered a question is there any distance measuring sensor in gazebo ?

If you take a look into the hokuyo model's SDF you can see, that the laser takes 640 samples (<samples>640</samples>). With the resolution (<resolution>1</resolution>) and the min angle and max angle (<min_angle>-2.26889</min_angle>, <max_angle>2.268899</max_angle>) you have everything you need.

Then for example in a plugin go through the samples (for this you should take a look in the control model tutorial) and check the distances: If sample 0 detects a low range then you know, that from your sensor direction in the angle of -2.26889 there is an object.

Edit: perhaps its easier to connect a simple ray sensor to your mobile robot. Then you can control things like angle and samples without editing the hokuyo model.

2013-07-31 04:36:25 -0600 answered a question Setting a joint in the right pose

I found out, that it is just a problem with the visualisation of the joint... the rotation is done correctly, although the joint axes are wrong...

The added rotation to the model turns the model and the sensor (and the joint, but it is not shown) I expected that the red x-axis points in the rotated direction...

image description

Here you can see the correct rotation -pi/2 (although the joint axis are not in the right positions)

image description

I want to add, that it is not enough to just rotate the sensor link!

image description image description

I think this might be connected with this bug?!

2013-07-31 03:00:44 -0600 commented answer Is it possible to get the contact point of a laser sensor?

Ok, thank you!

2013-07-29 06:31:37 -0600 asked a question Is it possible to get the contact point of a laser sensor?

Hi,

is there a simple solution for getting the coordinates on which the rays of a sensor hit a target? At the moment I calculate the points myself by using the sensor pose, the start and end angles and the samples, but I think there has to be an easier way to do that...

image description

2013-07-26 12:40:45 -0600 received badge  Popular Question (source)
2013-07-26 06:31:18 -0600 received badge  Notable Question (source)
2013-07-26 04:26:19 -0600 edited question Setting a joint in the right pose

Hi,


Updated description:

I would like to perform a rotation around a local Y-axis that points to another direction than the global Y-axis.

Global coordinate system is: span( (1,0,0); (0,1,0); (0,0,1) )

Local coordinate system shall be: span( (1/sqrt(2), -1/sqrt(2),0); (1/sqrt(2), 1/sqrt(2),0) ; (0,0,1) )

Now the desired rotation has to be around the new Y-axis (1/sqrt(2), 1/sqrt(2),0). As you can see below, when I add a rotation to the model pose, the sensor pose or the pose of the link, no rotation to my new coordinate system is added. Do I have to use the joint of type "revolute2" to add the "static" rotation around the Z-axis before performing the rotation around the "new / local" Y-axis? Is there another possibility?


Old description: I have to do a very simple operation: a child link (sensor) of a model shall do half of a rotation (SetJointPosition, 0 to -pi) around the parent link (box). I have a model for this with a parent and a child link. Everything is all right as long as the joints pose has no rotation in it.

<model name="box">
  <pose>0 0 0.5 0 0 0</pose>
  <static>false</static>
  <link name="link">
    <collision name="collision">...</collision>
    <visual name="collision">
      <geometry>
        <box>
          <size>1 1 1</size>
        </box>
      </geometry>
    </visual>
  </link>
  <link name="link2">
   <pose>0.0 0.0 0.51 0.0 0.0 0.0</pose>
    <sensor name="raysensor" type="ray">
      <always_on>true</always_on>
      <visualize>true</visualize>
      <ray>...</ray>
    </sensor>
  </link>
  <joint name="my_joint" type="revolute">
    <pose>0 0 0 0 0 0.785</pose>
    <parent>link</parent>
    <child>link2</child>
    <axis>
      <xyz>0 1 0</xyz>
    </axis>
  </joint>
</model>

Picture of the joint

The translation works. If I set an offset in x, y or z-coordinate the joint is shifted to the requested point. A rotation isn't done.

I tried to fix this with turning the whole model, but even this failed: Turning the whole model

What can I do to bring my joint in the right position?

2013-07-25 23:59:53 -0600 commented answer Setting a joint in the right pose

Yes, I tried to do this, but my local axes point in the same direction as the global axes... (like you see in the pictures)

2013-07-25 23:59:53 -0600 received badge  Commentator
2013-07-25 16:19:40 -0600 received badge  Popular Question (source)
2013-07-25 15:01:13 -0600 commented answer Setting a joint in the right pose

I want to have a second coordinate system. For example the original coordinate system is span( (1,0,0); (0,1,0); (0,0,1) ) and then the second system is span( (1/sqrt(2), -1/sqrt(2),0); (1/sqrt(2), 1/sqrt(2),0) ; (0,0,1) ). Then I want to rotate around the axis (1/sqrt(2), - 1/sqrt(2), 0). Is this possible?

2013-07-25 14:43:58 -0600 commented answer Setting a joint in the right pose

Thank you for your answer, but this is not what I wanted. This is the [result](http://tinypic.com/r/2mx08qe/5). Is it possible to get a "new" independent coordinate system? The new axes have to be translated and rotated so that the "new" y-axis points in another direction than the "original" y-axis. I want to rotate the sensor around the "new" y-axis.