Revision history [back]

I'm assuming you want to place the shelves in an L shape, correct? The ones along the X axis are placed properly, and now you want to place the others along the Y axis.

It looks like you tried two approaches at the same time. You put the distribution along the Y axis, and also rotated the whole population.

Let's try it as follows. Keep the distribution along Y and remove the rotation from the population's pose. Now we need to rotate each individual shelf along its own Z axis, rather than rotating the whole population. For that, we add a <pose> element to each shelf (within the <include> tag) just with a yaw of 1.57. As follows:

<population name="white_shelves_population2">
<model name="white_shelf2">
<include>
<static>true</static>
<uri>model://bookshelf</uri>
<pose>0.0 0.0 0.0 0.0 0.0 1.57</pose>
</include>
</model>
<pose>7.313923 1.442630 0.0 0.0 0.0 0.0</pose>
<box>
<size>0.5 14 3.0</size>
</box>
<model_count>14</model_count>
<distribution>
<type>linear-y</type>
</distribution>
</population>


I also increased the distribution to 14 shelves and changed the size accordingly. Here's how it looks like for me. Let me know if you were trying to do something different.

I'm assuming you want to place the shelves in an L shape, correct? The ones along the X axis are placed properly, and now you want to place the others along the Y axis.

It looks like you tried two approaches at the same time. You put the distribution along the Y axis, and also rotated the whole population.

Let's try it as follows. Keep the distribution along Y and remove the rotation from the population's pose. Now we need to rotate each individual shelf along its own Z axis, rather than rotating the whole population. For that, we add a <pose> element to each shelf (within the <include> tag) just with a yaw of 1.57. As follows:

<population name="white_shelves_population2">
<model name="white_shelf2">
<include>
<static>true</static>
<uri>model://bookshelf</uri>
<pose>0.0 0.0 0.0 0.0 0.0 1.57</pose>
</include>
</model>
<pose>7.313923 1.442630 0.0 0.0 0.0 0.0</pose>
<box>
<size>0.5 14 3.0</size>
</box>
<model_count>14</model_count>
<distribution>
<type>linear-y</type>
</distribution>
</population>


I also increased the distribution to 14 shelves and changed the size accordingly. Here's how it looks like for me. Let me know if you were trying to do something different.

UPDATE:

We could also keep the population along the X axis and rotate the population itself to be along Y. But even in this case, we still need to fix the orientation of each individual model. It might not be the most straightforward behaviour, but it looks like the distribution is only touching model positions and keeping orientations intact.

To do that, we change the distribution to linear-x, add a yaw rotation to the population pose and change the size accordingly:

<population name="white_shelves_population2">
<model name="white_shelf2">
<include>
<static>true</static>
<uri>model://bookshelf</uri>
<pose>0.0 0.0 0.0 0.0 0.0 1.57</pose>
</include>
</model>
<pose>7.313923 1.442630 0.0 0.0 0.0 1.57</pose>
<box>
<size>15 0.5 3.0</size>
</box>
<model_count>14</model_count>
<distribution>
<type>linear-x</type>
</distribution>
</population>