-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MAVLink XML change to allow exponentiation operator in bitmask flag #33
Comments
When is that going to be used in Mavlink definitions? Is it already there? |
More importantly, have you checked if it already works? The way mavlink-mappings works is it takes the content of the attribute and puts it straight in the generated code. Since Node.js already supports the For that reason, I am hesitant to make any additional parsing/interpreting of the values in XML definitions and just rely on the language to do the right thing. |
/**
* These flags encode the MAV mode.
*/
export enum MavModeFlag {
/**
* 0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly.
* Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and
* MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed
* state.
*/
'SAFETY_ARMED' = 2**7,
... |
Anything that uses mavgen will work because the python parser evaluates the Python evaluation operator before generating code. So yes, it works. We haven't rolled it out yet, but it is tested for mavgen. Generators that use some other language for the parsing will need to make sure the ** is evaluated as a exponentiation operator. Probably we'll look at making some bitmap changes in a few week.s |
Ping me when you're through. I'll check it. |
FYI We're modifying the MAVLink XSD validation file in ArduPilot/pymavlink#920 to allow a bitmask value to be declared using the Python exponentiation operator.
This makes it easier to immediately visualize which bit is set by a flag, because you can use the syntax
rather than
This is transparent to mavgen because the parser evaluates the number before creating the generated headers. However it may affect other parsers.
We're not updating the XML yet to allow other parsers time to update.
Any concerns, please raise on ArduPilot/pymavlink#920
The text was updated successfully, but these errors were encountered: