ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Diff_drive_controller - Question on RK function

asked 2016-11-09 12:02:42 -0600

bluehash gravatar image

Hello, In the diff_drive_controller plugin: https://github.com/ros-controls/ros_c...

What does the below line do? What is the 0.5 for?

const double direction = heading_ + angular * 0.5

The RK2 function is called when angular velocities are less than 1e-6 rads,

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-11-09 13:59:33 -0600

The 0.5 is coming from using an RK2 integration scheme. Specifically, from a quick glance at the code, it seems they are using what is often referred to as the Explicit Midpoint Method. This is a fully explicit RK scheme that has two stages (one at the left node, and one at the midpoint). The weight on the midpoint is 1/2 (that is where the 0.5 you are seeing comes in), and the weight on the left node is 0.

In simple terms the line mentioned in the original question is finding the midpoint orientation between the original orientation and the final orientation, and this midpoint orientation is being used for evaluating the sin and cos terms across the timestep.

edit flag offensive delete link more

Comments

Thank you for the explanation! It would be nice if the developer added that comment in... and also used brackets.

bluehash gravatar image bluehash  ( 2016-11-09 14:22:28 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-11-09 12:02:42 -0600

Seen: 209 times

Last updated: Nov 09 '16