Gazebo | Ignition | Community
Ask Your Question
0

Model can't be fixed the orientation

asked 2016-03-19 07:26:50 -0500

dyupleks gravatar image

updated 2016-03-19 07:32:10 -0500

Hello, Gazebo community!

I was learning the tutorial about the placing models in some orders and I wanted to implement it in my project. I took some models from 3D google repository and corrected them by following this tutorial.

My problem is the model (white_shelf2) can't be rotated on 90 degrees. I tried differently to fix the numbers of orientation (yaw exactly) in the world file (below it attached), but I cant still understand why the number were not published in Gazebo.

 <?xml version="1.0" ?> 
 <sdf version="1.5"> 
 <world name="default">

<include> 
<uri>model://ground_plane</uri> 
</include>

<include> 
<uri>model://sun</uri> 
</include>

<include> 
<uri>model://market_layout</uri> 
<name>market layout</name> 
<pose>0.107915 -0.228911 0.00 0.00 0.00 0.00</pose> 
</include>

<include> 
<uri>model://kassa</uri> 
<name>kassa</name> 
<pose>-4.712210 0.153002 -0.000002 0.000003 0.00 -1.573301</pose> 
</include>

<population name="white_shelves_population1"> 
<model name="white_shelf1"> 
<include>   
<static>true</static>   
<uri>model://white_shelves</uri> 
</include> 
</model> 
<pose>0.5 -7.4 0 0 0 0</pose> <!--pose of all shelves together -->  
<box>
<size>14 0.5 3</size> <!-- <size> is size of all shelves; all shelves will be in the size together -->
</box> 
<model_count>14</model_count> 
<distribution> 
<type>linear-x</type> <!-- models place along x-axis --> 
</distribution> 
</population>

<population name="white_shelves_population2"> 
<model name="white_shelf2"> 
<include> 
<static>true</static> 
<uri>model://white_shelves</uri> 
</include> 
</model> 
<pose>7.313923 1.442630 0.0 0.0 0.0 1.623000</pose> 
<box> 
<size>0.5 1.0 3.0</size> 
</box> 
<model_count>1</model_count> 
<distribution> 
<type>linear-y</type> 
</distribution> 
</population>
</world> 
</sdf>

This is screenshots:

image description

image description

In GUI, I placed the model in right position for getting the pose coordinates. Because, the "save" function doesn't work there, so I fixed the coordinates in my world file.

Jade, Ubuntu 14.04, Gazebo 5.1.0

Thank you in advance!

edit retag flag offensive close merge delete

Comments

Which number are you changing? You should change this line by editing the last number: <pose>7.313923 1.442630 0.0 0.0 0.0 1.623000</pose>

Peter Mitrano gravatar imagePeter Mitrano ( 2016-03-26 02:11:39 -0500 )edit

Which number are you changing? You should change this line by editing the last number: <pose>7.313923 1.442630 0.0 0.0 0.0 1.623000</pose>

Peter Mitrano gravatar imagePeter Mitrano ( 2016-03-26 02:12:00 -0500 )edit

Which number are you changing? You should change this line by editing the last number: ```<pose>7.313923 1.442630 0.0 0.0 0.0 1.623000</pose>```

Peter Mitrano gravatar imagePeter Mitrano ( 2016-03-26 02:12:23 -0500 )edit

There are two <population> tags. I have a problem with last one (white_shelves_population2). The <pose> 7.313923 1.442630 0.0 0.0 0.0 1.623000 </pose> doesnt fix in the model and the screenshots illustrates it.

dyupleks gravatar imagedyupleks ( 2016-03-26 03:27:20 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-03-27 11:34:56 -0500

chapulina gravatar image

updated 2016-03-28 11:30:16 -0500

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.

image description

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>
edit flag offensive delete link more

Comments

Thank you so much! Yes, I wanted to place the shelves in a L-shape. I didnt note that there exists <pose> in include's tag. @chapulina, why do the last 3 numbers need in population's <pose> in case it doesn't fix the orientation? & why cant it be rotated by population's <pose>?

dyupleks gravatar imagedyupleks ( 2016-03-28 04:17:17 -0500 )edit

That's a good question. It looks like population pose only affects positions, but not orientations. I updated the answer with an example.

chapulina gravatar imagechapulina ( 2016-03-28 11:32:24 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2016-03-19 07:26:50 -0500

Seen: 2,879 times

Last updated: Mar 28 '16