-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
Hello,
I've found this to be a good way of converting the position and orientation received by TelloLib to that of Unity's coordinate system.
Maybe after testing, methods for conversion could be added to the repo.
One thing I've noticed is the height data received from TelloLib seems erratic in my case, not really sure why.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TelloLib;
public class TelloPoseReceiver : MonoBehaviour {
public Vector3 m_position;
public Quaternion m_rotation;
void Start ()
{
Tello.onUpdate += Tello_onUpdate;
}
private void Tello_onUpdate(int cmdId)
{
m_position = new Vector3(Tello.state.posX, Tello.state.posZ, Tello.state.posY);
m_rotation = new Quaternion(-Tello.state.quatX, Tello.state.quatZ, Tello.state.quatY, Tello.state.quatW);
}
private void Update()
{
transform.SetPositionAndRotation(m_position, m_rotation);
//transform.rotation = m_rotation;
//transform.position = m_position;
}
private void OnApplicationQuit()
{
Tello.onUpdate -= Tello_onUpdate;
}
}comoc
Metadata
Metadata
Assignees
Labels
No labels