diff options
author | Florian Jung <flo@windfisch.org> | 2015-04-16 18:25:34 +0200 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2015-04-16 18:25:34 +0200 |
commit | c065db1f08e41646fd37ea34823f7768e6904bd0 (patch) | |
tree | b4542e62d2b475bc90a660d1ea9ce9e9ac8b94cd /lib.cpp | |
parent | f303c0d49e3e3e5089052d797f3ab2e821c01636 (diff) |
simple rotation commands
Diffstat (limited to 'lib.cpp')
-rw-r--r-- | lib.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -96,3 +96,17 @@ void DroneConnection::get(Mat& frame, navdata_t* nav) frame = Mat(720,1280,CV_8UC3, buffer); } + +void DroneConnection::fly(float x, float y, float z, float rot) +{ + char buf[100]; + int len = snprintf(buf, sizeof(buf), "fly %f %f %f %f\n", x,y,z,rot); + if (len >= sizeof(buf)-1) + { + printf("ERROR: buffer too small in DroneConnection::fly()!\n"); + return; + } + printf("%s\n",buf); + + write(sockfd, buf, len); +} |