forked from morse-simulator/morse
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mw/mavlink] Add support for attitude messsage
- Loading branch information
Arnaud Degroote
committed
Sep 16, 2015
1 parent
fb7410b
commit 252f99c
Showing
2 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import logging; logger = logging.getLogger("morse." + __name__) | ||
from morse.middleware.mavlink.abstract_mavlink import MavlinkSensor | ||
from pymavlink.dialects.v10 import common as mavlink | ||
|
||
class AttitudeSensor(MavlinkSensor): | ||
def make_msg(self): | ||
# Expects the coordinate in aeronautical frame | ||
self._msg = mavlink.MAVLink_attitude_message( | ||
self.time_since_boot(), | ||
self.data['rotation'][0], | ||
self.data['rotation'][1], | ||
self.data['rotation'][2], | ||
self.data['angular_velocity'][0], | ||
self.data['angular_velocity'][1], | ||
self.data['angular_velocity'][2] | ||
) |