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

AP_Scripting: added HobbyWing DataLink driver #25428

Merged
merged 2 commits into from
Nov 5, 2023

Conversation

tridge
Copy link
Contributor

@tridge tridge commented Nov 1, 2023

this supports the DataLink v2:
https://www.hobbywingdirect.com/products/data-link-v2
tested by Kyle from AerialVisionAustralia on a hexacopter
image

@tridge
Copy link
Contributor Author

tridge commented Nov 1, 2023

@IamPete1 Kyle has been hitting a problem where a scripting restart sometimes doesn't start the script. I added some debug code and it does get to reschedule_script() in lua_scripts::load_all_scripts_in_dir() so it isn't a microSD issue, but the script never runs (startup messages don't come out for example)
Any idea why this would happen? I can't reproduce with the same params on my CubeOrange (same board type)

@tridge tridge force-pushed the pr-hobbywing-datalink branch from 2c1ea3d to d09b404 Compare November 1, 2023 04:23
@IamPete1
Copy link
Member

IamPete1 commented Nov 1, 2023

@tridge Not sure on the script not running, I have seen lua get stuck in grabage collection before, #15555 it could be similar.

telem_data:current(curr)
telem_data:temperature_cdeg(math.floor(mos_temp*100))
esc_telem:update_rpm(ofs+i, math.floor(eRPM*10.0/ESC_HW_POLES:get()), 0)
-- 0x0D is temperature + voltage + current
Copy link
Member

Choose a reason for hiding this comment

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

With custom bindings we could make setting of the mask automatic. A valid value would add the bit to the mask and setting to nil would clear it.

Probably not worth the effort tho.

Copy link
Member

@IamPete1 IamPete1 Nov 1, 2023

Choose a reason for hiding this comment

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

Could do the same with if we used a multiple argument function rather than the userdata too. The binding would assemble the struct.

@tridge tridge added the WikiNeeded needs wiki update label Nov 4, 2023
@tridge tridge force-pushed the pr-hobbywing-datalink branch from 64917d9 to 4d2b3f9 Compare November 4, 2023 04:37
@tridge tridge merged commit c1831ba into ArduPilot:master Nov 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 4.4.3-beta1
Status: 4.4.3-beta1
Development

Successfully merging this pull request may close these issues.

3 participants