CoDrone Control


By Prof. Seungchul Lee
http://iai.postech.ac.kr/
Industrial AI Lab at POSTECH

  • Please submit the following files after today's class.
    • ipynb files
    • Demonstration videos of your drone
  • TA's E-mail : juwonna7@postech.ac.kr
    • The title of your mail should be "[MECH199-01][Drone & RC Car] (Group Name) WEEK3"

Table of Contents

1. Multiple DirectionĀ¶

1.1. Roll & PitchĀ¶

  • You can also set multiple directions at once. It makes your CoDrone to fly to the right and backwards at the same time.
InĀ [1]:
from CoDrone.codrone import *

drone = CoDrone()
drone.pair('3218')
drone.takeoff()

# -100 to 100 that sets the pitch variable.
# Drone goes diagonally for 1 second with 50 power
drone.set_roll(50)
drone.set_pitch(-65)
drone.move(1)
drone.land()

1.2. TipsĀ¶

  • If you do not want to continue moving in that direction, you must set the movement value back to zero. So in the second movement, the throttle was set back to zero so that it wouldn't continue to fly
InĀ [2]:
drone.takeoff()

# -100 to 100 that sets the throttle variable.
# Drone goes up for 1 second with 50 power
drone.set_throttle(100)
drone.move(1)
drone.set_throttle(0)
drone.land()
InĀ [3]:
drone.takeoff()

# -100 to 100 that sets the pitch and roll variable.
# Drone goes forward for 1 second with 50 power and goes right for 1 second with 50 power 
drone.set_pitch(50)
drone.move(1)
drone.set_pitch(0)
drone.set_roll(50)
drone.move(1)
drone.land()

2. Make EpisodeĀ¶

[1] ė‹¤ģ–‘ķ•œ ģ„¼ģ„œģ™€ Movement ėŖ…ė ¹ ģ½”ė“œė„¼ ģ”°ķ•©ķ•˜ģ—¬ ģ•„ėž˜ģ²˜ėŸ¼ ė‹¤ģ–‘ķ•œ Episode ė„¼ ė§Œė“¤ģ–“ė³“ģ„øģš”

  • ė†’ģ“ ģ „ģ§„ķ•˜ė‹¤ź°€ ģ±…ģƒ ģœ„ģ—ģ„œ ģ°©ė„™ķ•˜źø°
  • ź³„ė‹Ø ėŖØģ–‘ėŒ€ė”œ ķšŒģ „ķ•˜ė©° ė‚“ė ¤ź°€źø°

ģµœģ†Œ 3ź°œ ģ“ģƒģ˜ ģ„¼ģ„œģ™€ 4ģ¢…ė„˜ ģ“ģƒģ˜ ģ“ė™ ź“€ė Ø ķ•Øģˆ˜ ģ‚¬ģš©ķ•˜źø°!

2.1 Episode 1Ā¶

InĀ [4]:
# fill your code

2.2 Episode 2Ā¶

InĀ [5]:
# fill your code

3. Remote ControllerĀ¶

3.1. AssembleĀ¶

3.2. WiringĀ¶


3.3. ConnectĀ¶


Drone ON ā†’ Drone Calibration ā†’ Controller ON

3.4. ControlĀ¶

Check How to Land First!


InĀ [6]:
%%javascript

$.getScript('https://kmahelona.github.io/ipython_notebook_goodies/ipython_notebook_toc.js')