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

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?