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

pre arm checks: SN number add region parameter #101

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

Conversation

BluemarkInnovations
Copy link
Contributor

This PR adds:

  • region parameter: as each region has different mandatory fields/messages. For instance only in the EU the operator ID messages is mandatory. See https://github.com/opendroneid/opendroneid-core-c#comparison
  • performs basic checks whether the entered SN number meets the ANSI/CTA-2063-A standard
  • removes the mandatory requirement for the existence of SelfID messages
  • Although Japan is added as region, this is not fully compliant as it requires (support) for Auth messages too.
  • user can override these checks if Override pre-arm checks #76 is merged and set by the user

@BluemarkInnovations
Copy link
Contributor Author

@friissoren @tridge @Davidsastresas

Do you have feedback regarding this improved pre-arm check?

In general there are three kind of checks:

  • ardupilot
    • will check if the RID module is alive and generate an error if this fails.
    • it will also set the status to emergency in case there is an emergency
  • the check_parse function, that checks for valid data.
    • It uses the encode functions of the opendroneID lib for that.
    • In this PR the serial number check is added.
    • And also a region parameter to allow different checks for different regions.
    • would it be useful to add a default valid SN? like ARDU8REM0TE1D The default ABCD123456789 is not accepted by the SN check.
  • the arm_status_check function.
    • this checks mostly if new data is still arriving i.e. the timestamp is updated.

There are other PRs that relate a bit to this: #102 and #103

@Davidsastresas
Copy link

On QGC front I can accommodate it to whatever you guys do here and in Ardupilot. Just let me know what is necessary and I will include. Thanks!

@@ -37,6 +37,7 @@ const Parameters::Param Parameters::params[] = {
{ "PUBLIC_KEY4", Parameters::ParamType::CHAR64, (const void*)&g.public_keys[3], },
{ "PUBLIC_KEY5", Parameters::ParamType::CHAR64, (const void*)&g.public_keys[4], },
{ "MAVLINK_SYSID", Parameters::ParamType::UINT8, (const void*)&g.mavlink_sysid, 0, 0, 254 },
{ "REGION", Parameters::ParamType::UINT8, (const void*)&g.region, 0, 0, 3 }, // 0 = world, 1 = USA, 2 = Japan, 3 = EU
Copy link
Contributor

Choose a reason for hiding this comment

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

should use an enum for this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

implemented an enum, but it does not compile, need help from @tridge. The enum is not known in the RemoteIDModule.ino. The code also needs a rebase.

RemoteIDModule/transport.cpp Outdated Show resolved Hide resolved
@tridge
Copy link
Contributor

tridge commented Oct 16, 2023

@BluemarkInnovations I've restructured this to be cleaner and easier to follow. Please check!

@amilcarlucas
Copy link

@BluemarkInnovations any progress on this?

Copy link
Contributor Author

@BluemarkInnovations BluemarkInnovations left a comment

Choose a reason for hiding this comment

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

I like the restructuring of the code! Much better now.

I tried to compile this updated code and test it. It compiles, but somehow the parameter list was not shown anymore in DroneCAN GUI tool or MissionPlanner. This limited my tests, but looking to the code, everything seems okay to me.

switch (region) {
case Region::EU:
return REG_REQUIRE_LOC | REG_REQUIRE_BASIC_ID | REG_REQUIRE_OPERATOR_ID | REG_REQUIRE_OPERATOR_LOC | REG_REQUIRE_OPERATOR_ID | REG_REQUIRE_SERIAL_NUM;
case Region::JAPAN:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For now I would set Japan to WORLD. According to this page, two basic ID messages are needed, but also authentication messages. The latter is not implemented in ArduRemoteID. Therefore better to set it to WORLD, otherwise users may assume the firmware is compatible with Japan

WORLD=0,
USA=1,
JAPAN=2,
EU=3,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Based in on my experience, in some countries of the EU, also a CAA ID is mandatory for companies that fly drones. In those countries: there are 3 mandatory fields for companies: a) Serial Number b) CAA ID (company ID) c) pilot (operator ID). For now I would suggest to leave it as it, as I don't have a good overview or source that lists the requirements per EU country.

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.

5 participants