MultiWii | official MultiWii repository
kandi X-RAY | MultiWii Summary
kandi X-RAY | MultiWii Summary
MultiWii and MultiWiiConf -> is Alex working area, do not modified files here. Multiwii_shared and MultiWiiConf_shared can be modified by every contributors -> is a shared area for every commiter.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of MultiWii
MultiWii Key Features
MultiWii Examples and Code Snippets
Community Discussions
Trending Discussions on MultiWii
QUESTION
Using an Arduino, how would I go about getting attitude from the gyro in my flight controller using MultiWii Serial Protocol?
...ANSWER
Answered 2020-Feb-12 at 23:07The following is based on just getting gyro attitude information, although it includes some information about using MSP in general. The example code referenced can be found here. The most important part of this that I couldn't find anywhere else (a friend had figured it out and let me in on the secret) is the Data section below.
MultiWii Serial ProtocolFirstly, let's look at how MSP works. I found this link (alternative link here) very useful in understanding this, but I'll summarize here. There are three types of message that can be sent.
- Command -- a message sent to the flight controller which has some information to be sent.
- Request -- a message sent to the flight controller asking for some information to be returned.
- Response -- a message sent by the flight controller with information responding to a request.
MSP messages have a specific structure. They have a header, size, type, data and checksum, in that order.
I found this diagram from here very helpful:
HeaderThe header is three bytes and contains the message start characters "$M" and a character showing which direction the message is going. "<" denotes going to the flight controller (command and request), ">" denotes coming from the flight controller (response).
SizeThe fourth byte is the length (in bytes) of the data section. For example, if the data section had three INT 16 variables then the size byte would be 6.
TypeThe type byte specifies what information is being sent in the message. You can find a list of types here. An example of this would be MSP_ATTITUDE which has type number of 108.
DataThe data is where all the information is sent. Request messages have no data in them. Commands and responses do, because they contain information. The types of data returned can again be found here.
The difficult part of the data section is that the bytes are reversed in order, and this is extremely poorly documented. So, for example, if I get the following two bytes in this order:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install MultiWii
You can use MultiWii like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the MultiWii component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page