Skip to content

Conversation

@peterbarker
Copy link
Contributor

Fixes:

../../libraries/AP_Scripting/lua_bindings.cpp: In function 'int lua_AP_Vehicle_set_target_velocity_NED(lua_State*)': ../../libraries/AP_Scripting/lua_bindings.cpp:1240:23: error: 'check_AP_Vehicle' was not declared in this scope; did you mean 'check_AC_Fence'?
 1240 |     AP_Vehicle * ud = check_AP_Vehicle(L);
      |                       ^~~~~~~~~~~~~~~~
      |                       check_AC_Fence
compilation terminated due to -Wfatal-errors.

Tested with:

pbarker@crun:~/rc/ardupilot(master)$ ./Tools/autotest/test_build_options.py --define-match-glob=AP_SCRIPTING_BINDING_VEHICLE_ENABLED --build-target plane

#endif // AP_GPS_ENABLED

#if AP_VEHICLE_ENABLED
#if AP_SCRIPTING_BINDING_VEHICLE_ENABLED
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems messed up to me. The config element is not dependent on AP_VEHICLE_ENABLED which I think it should be. Also the implementations in Copter (for example) are conditionally compiled via #if AP_SCRIPTING_ENABLED which is different again

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This seems messed up to me. The config element is not dependent on AP_VEHICLE_ENABLED which I think it should be. Also the implementations in Copter (for example) are conditionally compiled via #if AP_SCRIPTING_ENABLED which is different again

Yes, it definitely should be dependent on AP_VEHICLE_ENABLED. Not sure why it is not. Only Periph would be affected and it turns it off explicitly.

Copter could (and should probably) use the narrower define.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've pushed up a patch which adds the dependency on AP_VEHICLE_ENABLED (and AP_SCRIPTING_ENABLED....).

I've looked at Copter. Using the tighter define might be good in that it adds information about the method - the fact that you probably don't want to call it in general ArduCopter code, rather just from scripting). I don't think it's worth the hassle of including a patch for that in this PR, 'though.

@peterbarker peterbarker force-pushed the pr/vehicle-scripting-binding-fix branch from 564f2f3 to f19efdc Compare January 2, 2026 22:19
…ENABLED

Fixes:

../../libraries/AP_Scripting/lua_bindings.cpp: In function 'int lua_AP_Vehicle_set_target_velocity_NED(lua_State*)':
../../libraries/AP_Scripting/lua_bindings.cpp:1240:23: error: 'check_AP_Vehicle' was not declared in this scope; did you mean 'check_AC_Fence'?
 1240 |     AP_Vehicle * ud = check_AP_Vehicle(L);
      |                       ^~~~~~~~~~~~~~~~
      |                       check_AC_Fence
compilation terminated due to -Wfatal-errors.
@peterbarker peterbarker force-pushed the pr/vehicle-scripting-binding-fix branch from f19efdc to 09fea0a Compare January 3, 2026 01:27
@peterbarker peterbarker moved this to ReadyForDevCall in Peter's ArduPilot 4.7 Queue Jan 5, 2026
@andyp1per andyp1per merged commit abf75c1 into ArduPilot:master Jan 6, 2026
107 of 108 checks passed
@github-project-automation github-project-automation bot moved this from ReadyForDevCall to Done in Peter's ArduPilot 4.7 Queue Jan 6, 2026
@peterbarker peterbarker deleted the pr/vehicle-scripting-binding-fix branch January 7, 2026 00:47
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