pyaidrone 2.9__tar.gz → 3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyaidrone
3
- Version: 2.9
3
+ Version: 3.0
4
4
  Summary: Library for AIDrone Products
5
5
  Home-page: http://www.ir-brain.com
6
6
  Author: IR-Brain
@@ -346,25 +346,33 @@ class AIDrone:
346
346
  self.posX = self.posY = 0
347
347
  self.setOption(OPT_FLIGHT_VEL)
348
348
 
349
- def rc_control(self, roll=0, pitch=0, yaw=0, throttle=None):
350
- """roll·pitch·yaw 를 한 번에 준다 (실시간 수동 조종용).
349
+ def rc_control(self, roll=0, pitch=0, yaw=None, throttle=None):
350
+ """roll·pitch 를 한 번에 준다 (실시간 수동 조종용).
351
351
 
352
352
  velocity() 를 앞뒤·좌우로 따로 부르면 서로 필드를 0으로 덮어써서
353
353
  한 방향만 먹는다. 대각선 이동이나 방향키 동시 입력에는 이 메서드를 쓴다.
354
354
 
355
355
  roll : 좌우 속도 (오른쪽 +, 왼쪽 -) -VEL_MAX ~ VEL_MAX
356
356
  pitch : 전후 속도 (앞 +, 뒤 -)
357
- yaw : 회전 속도 (오른쪽 +, 왼쪽 -)
357
+ yaw : 목표 회전 '절대각도'(도). None 이면 현재 방향을 그대로 유지한다.
358
+ ※ 회전은 rotation()/rotationTo() 로 각도를 누적하는 것을 권장.
359
+ (이 드론의 YAW 는 '속도'가 아니라 '이륙 기준 절대각'이라,
360
+ 속도 0 을 주면 원래 방향으로 돌아가 버린다.)
358
361
  throttle : 고도(cm). None 이면 기존 고도 유지
359
362
 
360
- Tello 의 send_rc_control(lr, fb, ud, yaw) 대응한다.
363
+ Tello 의 send_rc_control 달리, yaw 비우면 각도가 유지된다.
361
364
  """
362
365
  roll = DefLib.constrain(int(roll), VEL_MAX, VEL_MIN)
363
366
  pitch = DefLib.constrain(int(pitch), VEL_MAX, VEL_MIN)
364
- yaw = DefLib.constrain(int(yaw), YAWVEL_MAX, -YAWVEL_MAX)
365
367
  self.makepkt.setField(Packet.IDX_ROLL, roll)
366
368
  self.makepkt.setField(Packet.IDX_PITCH, pitch)
367
- self.makepkt.setField(Packet.IDX_YAW, yaw)
369
+ if yaw is not None:
370
+ # 절대 각도로 설정하고 내부 상태(rot)도 갱신 → 이후에도 유지됨
371
+ self.rot = (int(yaw) + 180) % 360 - 180
372
+ self.makepkt.setField(Packet.IDX_YAW, self.rot)
373
+ else:
374
+ # yaw 를 건드리지 않고 현재 각도(self.rot)를 그대로 유지
375
+ self.makepkt.setField(Packet.IDX_YAW, self.rot)
368
376
  if throttle is not None:
369
377
  self.makepkt.setField(Packet.IDX_THR,
370
378
  DefLib.constrain(int(throttle), ALT_MAX, ALT_MIN),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyaidrone
3
- Version: 2.9
3
+ Version: 3.0
4
4
  Summary: Library for AIDrone Products
5
5
  Home-page: http://www.ir-brain.com
6
6
  Author: IR-Brain
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="pyaidrone",
5
- version="2.9",
5
+ version="3.0",
6
6
  description="Library for AIDrone Products",
7
7
  long_description=open("README.md").read(), # README.md 내용을 long_description으로 사용
8
8
  long_description_content_type="text/markdown", # README 파일이 markdown 형식임을 지정
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes