I've got the robot's travel segments and intend to visualize it against the backdrop of grid layout. These travel segments are determined as function of wheel rotational difference between two wheels. I've the data streaming in for each of the wheels -- left and right. Is there a way to dynamically draw the plot as the data streams in?
In the pic shown above on the left side are the distance segments undertaken by the robot that I would like to programmatically plot resembling the dotted line in the grid pattern on the right side.
The entire process of turning left and right starts way before in advance, anticipating the edge of the blocks for a smooth turn. I'd like to plot the path keeping the spirit of these smoothed transitions. This is where I'm seeking help.
I've got a few ideas to go about the task but not sure if I can put those into code and hence need help with. The logic goes as follows: Assuming it starts at the origin, 1) I'd draw vertical line from (0,0) to (0, 29 + 18/2), 2) and then join the line from (0, 29 + 18/2) to (-18/2 + (-24/2), 29 + 18/2) 3) followed by a line joining (-18/2 + (-24/2), 29 + 18/2) to (-18/2 + (-24/2), (29 + 18/2) + 19)
I, having split left and right turns in equal halves, added the halves to the adjacent straight paths making the plot to have sharp turns. But I'm looking for a better solution appreciating the data shown on the left.