# Significance of mathematical operation in solution exercise 2.3

**URL:** <https://get-help.theconstruct.ai/t/significance-of-mathematical-operation-in-solution-exercise-2-3/23924>\
**Category:** TF ROS 101\
**Created:** [April 21, 2023, 2:27am UTC](https://get-help.theconstruct.ai/t/significance-of-mathematical-operation-in-solution-exercise-2-3/23924 "2023-04-21T02:27:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rasitharaghu](https://get-help.theconstruct.ai/letter_avatar_proxy/v4/letter/r/4491bb/32.png) [@rasitharaghu](https://get-help.theconstruct.ai/u/rasitharaghu)\
**Post date:** [April 21, 2023, 2:27am UTC](https://get-help.theconstruct.ai/t/significance-of-mathematical-operation-in-solution-exercise-2-3/23924/1 "2023-04-21T02:27:24Z")

</div>

Hi,

What is the significance of ‘t = (rospy.Time.now().to\_sec() \* math.pi)\*turning\_speed\_rate’  
in the solution of exercise 2.3. Does it really lead to an angular speed of 2 radians/s?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![duckfrost2](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/duckfrost2/32/9365_2.png) [@duckfrost2](https://get-help.theconstruct.ai/u/duckfrost2)\
**Post date:** [April 21, 2023, 10:31am UTC](https://get-help.theconstruct.ai/t/significance-of-mathematical-operation-in-solution-exercise-2-3/23924/2 "2023-04-21T10:31:28Z")

</div>

Hi,

Its just a way of making it turn certain radians at a certain speed. Its not 2 radians perfectly, it was just a fast way of doing this

---

<div class="post-metadata">

**Author:** ![jpachecog](https://get-help.theconstruct.ai/letter_avatar_proxy/v4/letter/j/7ba0ec/32.png) [@jpachecog](https://get-help.theconstruct.ai/u/jpachecog)\
**Post date:** [December 15, 2023, 4:22am UTC](https://get-help.theconstruct.ai/t/significance-of-mathematical-operation-in-solution-exercise-2-3/23924/3 "2023-12-15T04:22:46Z")

</div>

Hi,  
It actually doesn’t lead to a velocity of 2 radians/s. Let’s re-examine this portion of the solution:

```auto
t = (rospy.Time.now().to_sec() * math.pi)*turning_speed_rate
# Map to only one turn maximum [0,2*pi)
rad_var = t % (2*math.pi)

my_quaternion = tf.transformations.quaternion_from_euler(0.0,0.0,rad_var)

```

In this snippet, `t` represents the angle turned by the frame over time. To achieve a consistent velocity of 2 rad/s, the calculation of `t` should be `t = rospy.Time.now().to_sec() * 2` . This adjustment aligns with the formula **θ = t \* ω** , where **θ** is the angular displacement and **ω** is the angular velocity.

Regards,  
Jose
