# Given the directions and distances the robot traveled, how to generate a plot against a grid layout in a rather smoothed manner? [closed]

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.

## closed as unclear what you're asking by N. Staub, Mark Booth♦Oct 11 at 16:41

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• it appears that you are asking how to draw a line on a grid ..... please explain how this sort of thing relates to robotics – jsotola Oct 10 at 21:15
• @jsotola 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? – user007 Oct 10 at 21:28
• Welcome to Robotics user007, but I'm afraid that it is not clear what you are asking. We prefer practical, answerable questions based on actual problems that you face, so it's a good idea to include details of what you want to achieve, what you tried, what you saw & what you expected to see. Please take a look at How to Ask & tour for more information on how stack exchange works and work through the Robotics question checklist to edit your question to make it clearer. – Mark Booth Oct 11 at 16:36
• If you are asking how to draw coordinates on a map, that would be off-topic. If you are asking how to fuse the data from your encoders with your starting position, to estimate absolute position over time, you are asking a sensor-fusion question, and probably need to look into using a kalman-filter. In any case, it probably isn't a path-planning question. – Mark Booth Oct 11 at 16:40