Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ground Control Commands #22

Open
avesk opened this issue Oct 18, 2019 · 0 comments
Open

Ground Control Commands #22

avesk opened this issue Oct 18, 2019 · 0 comments
Assignees
Labels
Difficult This issue will be difficult to resolve.

Comments

@avesk
Copy link
Contributor

avesk commented Oct 18, 2019

This issue will be split up into several smaller issues. The purpose of this is to consolidate the specifications of the ground control module.

Overview

On the ground vehicle there will be an arduino that controls the motors of the vehicle. The GroundControl application is responsible for translating commands from computer vision system to the arduino. To do so information is transmitted over a serial port.

Calculating the Path

The computer vision application is responsible for identifying targets in a scene. Once it has found a point of interest it will send the coordinates of the target to the ground control application.

Ground control must then identify what the most appropriate path is for the vehicle to take in order to get to the target. Typically a straight line would not be appropriate since the vehicle should be lined up with the target prior to reaching it. There is a lot of information online about calculating paths for autonomous vehicles and they should studied for this problem. There is a great medium article that looks at important factors for path planning that can be found here. Note this is a fairly difficult task which requires 'camera math' to calculate distance to the target and much more funky math so work in a group and collaborate.

Constructing Serial Packets

To control the speed and direction of the vehicle, onboard computer will be sending packets to the arduino which controlls the motors directly. GroundControl will be generating packets that contain information on how the motor speed should be set in order for the vehicle to travel along the computed path. These packets follow a specific structure that is illustrated bellow. The structure is a 16 Bit packet where the first bit is a flag indicating if the ground vehicle should do a 180, the second bit is a flag indicating if the vehicle should break, and the rest of the structure is for setting motor speed and directions.

  • bit 1: 180 flag
  • bit 2: break flag
  • bit 3: motor A direction
  • bits 4 - 9: speed of motor A
  • bit 10: motor B direction
  • bits 11-15: speed of motor B
180 brake dir1 speed dir2 speed2
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Sending Packet Over Serial Port

To transport this packets to the arduino we will use a serial protocol. There is a good tutorial on using serial with the raspberry py here. In order to package the large set of bits to send to the arduino we will convert the bits into a hexidecimal value and send the information in that form. There is an example of this being done on a form here

Specific Manuevers

  • 180 Degree Spin: As of now the only special manuever that will need to be sent to the arduino will be a 180 maneuver. Which will be communicated by setting the first bit of the serial packet to 1. After sending the arduino the command to complete a 180 degree spin
@avesk avesk added the Difficult This issue will be difficult to resolve. label Oct 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Difficult This issue will be difficult to resolve.
Projects
None yet
Development

No branches or pull requests

3 participants