# Chris's profile - activity

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>
<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>


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>
<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>
<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>
<joint name="my_joint" type="revolute">
<axis>
<xyz>0 0 1</xyz>
</axis>
</joint>
</model>


In gazebo there is the following result:

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

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

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: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...

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

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

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...

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>
<collision name="collision">...</collision>
<visual name="collision">
<geometry>
<box>
<size>1 1 1</size>
</box>
</geometry>
</visual>
<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>
<joint name="my_joint" type="revolute">
<pose>0 0 0 0 0 0.785</pose>
<axis>
<xyz>0 1 0</xyz>
</axis>
</joint>
</model>


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:

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)