#Run the app
./gradlew clean build
DroneServiceTest > forwardMoveTest() STANDARD_OUT
09:10:20.673 [Test worker] INFO com.drone.drone.service.MotionService - Drone in Forward Direction
DroneServiceTest > landTest() STANDARD_OUT
09:10:20.683 [Test worker] INFO com.drone.drone.service.MotionService - Drone are in down direction
DroneServiceTest > rightTest() STANDARD_OUT
09:10:20.690 [Test worker] INFO com.drone.drone.service.MotionService - Drone in Right Direction
DroneServiceTest > stabilizeTest() STANDARD_OUT
09:10:20.693 [Test worker] INFO com.drone.drone.service.MotionService - Drone are in up direction
09:10:20.694 [Test worker] INFO com.drone.drone.service.MotionService - Drone in hover mode.
DroneServiceTest > takeOffTest() STANDARD_OUT
09:10:20.701 [Test worker] INFO com.drone.drone.service.MotionService - Drone are in up direction
###Back to Front #####rotation about this axis -> Roll #Pitch axis ###Left to right
#Yaw axis
#Thrust Formula
F = m * v F = ma
= (m/t) * v = m * (dv/dt) : dv rate of change of velocity
where m is mass, v is velocity
- Thrust = weight -> hover condition
- Thrust > weight -> upward condition
- Thrust < weight -> downward condition
#Direction of Thrust
- move drone to forward direction
- Increase the power of rare motor
- Reduce the power of front motor
- move drone to Backward motion
- Reduce the power of rare motor
- Increase the power of front motor
- move drone left
- Increase the power of right motor
- reduce the power of left motor
- move drone to right
- Reduce the power of right motor
- increase the power of left motor
#Algorithm
-
take_off()
- given weight
- calculate thrust(given velocity)
-
Thrust(Velocity vel)
- f = weight * vel
- compare thrust vs weight
- if thrust > weight
- then take of
- if(thrust < weight){
- then take down
- if(thrust == weight){
- then hover
-
interface drone
- void takeOff(Drone drone);
- void stabilize(Drone drone);
- void land(Drone drone);
- Drone status(Drone drone);
- void move(Drone drone);
-
interface motion
- void forward(Drone drone);
- void back(Drone drone);
- void left(Drone drone);
- void right(Drone drone);
- void up(Drone drone);
- void down(Drone drone);
-
void forward(List engines);
- rare engine with power 10
- front engine with power 1
-
void back(List engine);
- rare engine with power 1
- front engine with power 10
-
void left(List engine);
- right engine with power 10
- left engine with power 1
-
void right(List engine);
- right engine with power 1
- left engine with power 10
-
void down(Gyroscope gyroscope);
- call thrust function with gyroscope velocity (z= -10)
-
void up(Gyroscope gyroscope);
- call thrust function with gyroscope velocity (z= 10)
-
stabilize()
- call take_off()
- call status() : will provide the pitch and roll
- call thrust function : thrust == weight
-
land()
- call take_off()
- call status() -call thrust function : thrust < weight
-
status(Grade grade)
- return pitch and roll (OrientationSensor);