[CNIT 581-SDR / Spring 2019] Week 12 – Navigation Control from coordinate

 

In the previous blog, we had decided to send a JSON file format to adjust the motors of Hamster robot. However, we found that the structure in the mobile environment is entirely different from our original thought. When a user drew some lines in the display, the object that receives the user’s input takes two coordinates of starting and ending points with curved information.

(https://developer.apple.com/documentation/uikit/uibezierpath?language=objc)

When we took the coordinates of drawing, it has not only information on starting and ended points but also has ‘quadto’  information which shows us lines has a geometric shape. The picture below is about a JSON file containing coordinates of two paths.

Screen Shot 2019-04-06 at 12.41.57 AM.png
Picture updated: 04/06/2019 12:58AM

 

Therefore, we refer to a blog explaining robots’ turning method. To turn right or left accurate, we need to calculate the angular velocity of the left wheel and the angular velocity of the right wheel. We need to control the position of the robot in x coordinate and y coordinate as well as its orientation.

Same speed of both wheels: go straight
The speed of a wheel is smaller: the robot turns in that direction

Screen Shot 2019-04-05 at 3.04.43 PM

(http://enesbot.me/kinematic-model-of-a-differential-drive-robot.html)

After reading it, we realized that the second assignment of SDR class is similar to our purpose so now we are examining how we will implement the manipulation of robot motors by these two references.

 

 

[CNIT 581-SDR / Spring 2019] Week 10 – Mobile Application

 

For the mobile side, we’ve built an application that users can draw some lines with the width information.

Screen Shot 2019-03-20 at 9.45.24 PM

The white square at the center of this application is the drawing area which can get users’ input. Some black lines will be drawn along with the input. The blue buttons on the bottom are for the thickness of lines so that the users can simply select the desired one. We added a reset button in the case of redrawing.

 

Screen Shot 2019-03-20 at 10.00.27 PM

The ‘Send’ button at the below is to send trajectory information to a physical robot. The data is about the relative coordinates with a starting point rather than the absolute coordinates. The drawing information would be saved by JSON type, as shown in the example below.

{'item_number' : 3, 
 'infos': {
  {
   'starting_point' : [149.0,30.8], 
   'thickness' : 1
   'coordinates' : [[A,B], [C,D], [E,F], ...]
  },
  {
   'starting_point' : [167.0,20.3], 
   'thickness' : 2
   'coordinates' : [[A',B'], [C',D'], [E',F'], ...]
  },
  {
   'starting_point' : [195.0,16.2], 
   'thickness' : 3
   'coordinates' : [[A'',B''], [C'',D''], [E'',F''], ...]
  }
 }
}

Depending on the receiver point, data structure and each item can be changed.

 

Create your website with WordPress.com
Get started