Skip to content
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

upstream update some descriptions and add invalid attributes #254

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

amilcarlucas
Copy link

@amilcarlucas amilcarlucas commented Mar 15, 2022

@peterbarker can you review this one?
I plan to discuss it on the next meeting.

@@ -3447,7 +3447,7 @@
<field type="uint8_t" name="target_system">System ID</field>
<field type="uint8_t" name="target_component">Component ID</field>
<field type="char[16]" name="param_id">Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string</field>
<field type="int16_t" name="param_index">Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)</field>
<field type="int16_t" name="param_index" invalid="-1">Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)</field>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't invalid. The meaning of -1 is specified right there :-)

@@ -3571,7 +3571,7 @@
<field type="float" name="pitchspeed" units="rad/s">Pitch angular speed</field>
<field type="float" name="yawspeed" units="rad/s">Yaw angular speed</field>
<extensions/>
<field type="float[4]" name="repr_offset_q">Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode.</field>
<field type="float[4]" name="repr_offset_q" invalid="[0]">Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode.</field>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be [0, 0, 0, 0]?

<field type="int16_t" name="y" invalid="INT16_MAX">Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle.</field>
<field type="int16_t" name="z" invalid="INT16_MAX">Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust.</field>
<field type="int16_t" name="r" invalid="INT16_MAX">R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle.</field>
<field type="uint16_t" name="buttons">A bitfield corresponding to the joystick buttons' 0-15 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1.</field>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this still make sense gramatically?

Comment on lines +3956 to +3962
<field type="float" name="param1" invalid="NaN">PARAM1, see MAV_CMD enum</field>
<field type="float" name="param2" invalid="NaN">PARAM2, see MAV_CMD enum</field>
<field type="float" name="param3" invalid="NaN">PARAM3, see MAV_CMD enum</field>
<field type="float" name="param4" invalid="NaN">PARAM4, see MAV_CMD enum</field>
<field type="int32_t" name="x" invalid="INT32_MAX">PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7</field>
<field type="int32_t" name="y" invalid="INT32_MAX">PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7</field>
<field type="float" name="z" invalid="NaN">PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame).</field>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How badly does passing NaN in break ArduPilot?

We can't start to recommend GCS authors / CC-program authors pass NaN in if it will thoroughly break ArduPilot - not just the current version, but all recent stable versions!

Similarly on COMMAND_LONG

</message>
<message id="77" name="COMMAND_ACK">
<description>Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at https://mavlink.io/en/services/command.html</description>
<field type="uint16_t" name="command" enum="MAV_CMD">Command ID (of acknowledged command).</field>
<field type="uint8_t" name="result" enum="MAV_RESULT">Result of command.</field>
<extensions/>
<field type="uint8_t" name="progress">Also used as result_param1, it can be set with a enum containing the errors reasons of why the command was denied or the progress percentage or 255 if unknown the progress when result is MAV_RESULT_IN_PROGRESS.</field>
<field type="uint8_t" name="progress" invalid="UINT8_MAX">Also used as result_param1, it can be set with an enum containing the errors reasons of why the command was denied, or the progress percentage when result is MAV_RESULT_IN_PROGRESS (UINT8_MAX if the progress is unknown).</field>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be zero for unknown, given that this is an extension and may not be transmitted correctly?

@@ -4358,7 +4358,7 @@
<field type="int16_t" name="temperature" units="cdegC">Temperature</field>
<field type="uint8_t" name="quality">Optical flow quality / confidence. 0: no valid flow, 255: maximum quality</field>
<field type="uint32_t" name="time_delta_distance_us" units="us">Time since the distance was sampled.</field>
<field type="float" name="distance" units="m">Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance.</field>
<field type="float" name="distance" units="m" invalid="-1.0">Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance.</field>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is problematic; the invalid field isn't matching the description. I reckon just change the description...

@@ -5114,28 +5120,30 @@
<field type="char[205]" name="file_url">URL of image taken. Either local storage or http://foo.jpg if camera provides an HTTP interface.</field>
</message>
<message id="264" name="FLIGHT_INFORMATION">
<description>Information about flight since last arming.</description>
<description>Information about flight since last arming.
This can be requested using MAV_CMD_REQUEST_MESSAGE.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this message explicitly nominate this fact?

@@ -5300,7 +5308,7 @@
<description>Obstacle distances in front of the sensor, starting from the left in increment degrees to the right</description>
<field type="uint64_t" name="time_usec" units="us">Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.</field>
<field type="uint8_t" name="sensor_type" enum="MAV_DISTANCE_SENSOR">Class id of the distance sensor type.</field>
<field type="uint16_t[72]" name="distances" units="cm">Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm.</field>
<field type="uint16_t[72]" name="distances" units="cm" invalid="[UINT16_MAX]">Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm.</field>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an element-by-element thing - i.e. just because the first element is invalid doesn't mean all elements are invalid. As opposed to the quaternion thing above where if NaN is in any element that's bad....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants