# Unable to see the Coke can to rotate around the Turtlebot

**URL:** <https://get-help.theconstruct.ai/t/unable-to-see-the-coke-can-to-rotate-around-the-turtlebot/14410>\
**Category:** Basic Kinematics of Mobile Robots\
**Created:** [December 24, 2021, 7:15pm UTC](https://get-help.theconstruct.ai/t/unable-to-see-the-coke-can-to-rotate-around-the-turtlebot/14410 "2021-12-24T19:15:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vasileios.tzimas](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/vasileios.tzimas/32/6560_2.png) [@vasileios.tzimas](https://get-help.theconstruct.ai/u/vasileios.tzimas)\
**Post date:** [December 24, 2021, 7:15pm UTC](https://get-help.theconstruct.ai/t/unable-to-see-the-coke-can-to-rotate-around-the-turtlebot/14410/1 "2021-12-24T19:15:25Z")

</div>

Hello, community, and Merry Christmas!

I’m trying to execute the following script in Unit 2 section 2.3:

```auto
import math, rospy
from utilities import set_model_state, get_model_state
from geometry_msgs.msg import Pose, Point, Quaternion

x, y, z = 1, 0, 0.22
for angle in range(0,360,10):
    theta = math.radians(angle)
    xp = x * math.cos(theta) - y * math.sin(theta)
    yp = x * math.sin(theta) + y * math.cos(theta)
    set_model_state('coke_can', Pose(position=Point(xp,yp,z)))
    rospy.sleep(0.1)

```

but unfortunately, the coke can doesn’t rotate around the Turtlebot nor appears.  
A short sample:

Why that?

---

<div class="post-metadata">

**Author:** ![vasileios.tzimas](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/vasileios.tzimas/32/6560_2.png) [@vasileios.tzimas](https://get-help.theconstruct.ai/u/vasileios.tzimas)\
**Post date:** [December 24, 2021, 7:50pm UTC](https://get-help.theconstruct.ai/t/unable-to-see-the-coke-can-to-rotate-around-the-turtlebot/14410/2 "2021-12-24T19:50:23Z")

</div>

I think extra code is missing from the script

```auto
import math, rospy
from utilities import set_model_state, get_model_state, \
                      spawn_coke_can
from geometry_msgs.msg import Pose, Point, Quaternion

if get_model_state('coke_can').success == False:
    spawn_coke_can('coke_can', Pose(position=Point(1,0,0.22)))

x, y, z = 1, 0, 0.22

for angle in range(0,360,10):
    theta = math.radians(angle)
    xp = x * math.cos(theta) - y * math.sin(theta)
    yp = x * math.sin(theta) + y * math.cos(theta)
    set_model_state('coke_can', Pose(position=Point(xp,yp,z)))
    rospy.sleep(0.1)

```

---

<div class="post-metadata">

**Author:** ![albertoezquerro](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/albertoezquerro/32/7031_2.png) [@albertoezquerro](https://get-help.theconstruct.ai/u/albertoezquerro)\
**Post date:** [December 27, 2021, 8:43am UTC](https://get-help.theconstruct.ai/t/unable-to-see-the-coke-can-to-rotate-around-the-turtlebot/14410/3 "2021-12-27T08:43:37Z")

</div>

Hello @vasileios.tzimas ,

Yes, you are right. This script, **unit2\_rotations.py** , is meant to be executed right after the previous script, **unit2\_positions.py** (which does the spawn of the coke). Therefore, it expects the coke to be already spawned. If it is not, then it’s not going to work properly. I’ll add some notes to the notebook to indicate this.
