Commit d2c14d70 authored by Léo-Paul Géneau's avatar Léo-Paul Géneau 👾

component/mavsdk: v↑ mavsdk (0.39.0 -> 1.4.13)

parent cf76e708
...@@ -4,9 +4,12 @@ extends = ...@@ -4,9 +4,12 @@ extends =
../curl/buildout.cfg ../curl/buildout.cfg
../git/buildout.cfg ../git/buildout.cfg
../jsoncpp/buildout.cfg ../jsoncpp/buildout.cfg
../lxml-python/buildout.cfg
../macros/macro.pythonpath.eggs.cfg
../qjs-wrapper/buildout.hash.cfg ../qjs-wrapper/buildout.hash.cfg
../tinyxml2/buildout.cfg ../tinyxml2/buildout.cfg
../zlib/buildout.cfg ../zlib/buildout.cfg
buildout.hash.cfg
parts = parts =
mavsdk mavsdk
...@@ -16,11 +19,10 @@ recipe = slapos.recipe.build:download ...@@ -16,11 +19,10 @@ recipe = slapos.recipe.build:download
shared = true shared = true
url = ${:_profile_base_location_}/../qjs-wrapper/${:filename} url = ${:_profile_base_location_}/../qjs-wrapper/${:filename}
[c-astral-headers] [message-definition]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:download
repository = https://lab.nexedi.com/nexedi/c-astral-c-library shared = true
revision = v2.0 url = ${:_profile_base_location_}/${:filename}
git-executable = ${git:location}/bin/git
[gcc] [gcc]
min_version = 7.1 min_version = 7.1
...@@ -28,18 +30,37 @@ min_version = 7.1 ...@@ -28,18 +30,37 @@ min_version = 7.1
[mavsdk-source] [mavsdk-source]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = https://github.com/mavlink/MAVSDK.git repository = https://github.com/mavlink/MAVSDK.git
revision = v0.39.0 revision = v1.4.13
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
ignore-cloning-submodules = true ignore-cloning-submodules = true
[future]
recipe = zc.recipe.egg:custom
egg = future
[mavsdk-env]
CMAKE_INCLUDE_PATH=${curl:location}/include:${jsoncpp:location}/include:${tinyxml2:location}/include
CMAKE_LIBRARY_PATH=${curl:location}/lib:${jsoncpp:location}/lib:${tinyxml2:location}/lib:${zlib:location}/lib
CMAKE_PROGRAM_PATH=${cmake:location}/bin
PATH=${pkgconfig:location}/bin/:%(PATH)s
LDFLAGS=-L${curl:location}/lib -Wl,-rpath=${curl:location}/lib -L${jsoncpp:location}/lib -Wl,-rpath=${jsoncpp:location}/lib -L${tinyxml2:location}/lib -Wl,-rpath=${tinyxml2:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib -Wl,-rpath=@@LOCATION@@/lib
[mavsdk-pythonpath]
<= macro.pythonpath.eggs
environment = mavsdk-env
eggs =
${future:egg}
${lxml-python:egg}
[mavsdk] [mavsdk]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
path = ${mavsdk-source:location} path = ${mavsdk-source:location}
cmake = ${cmake:location}/bin/cmake cmake = ${cmake:location}/bin/cmake
depends = ${mavsdk-pythonpath:recipe}
pre-configure = pre-configure =
${git:location}/bin/git submodule update --init --recursive ${git:location}/bin/git submodule update --init --recursive
cp -r ${c-astral-headers:location}/mavlink/v2.0/* ${mavsdk-source:location}/src/third_party/mavlink/include/mavlink/v2.0/ sed -i 's#message_definitions/v1.0#${message-definition:location}#' ${mavsdk-source:location}/third_party/mavlink/CMakeLists.txt
configure-command = configure-command =
${:cmake} ${:cmake}
configure-options = configure-options =
...@@ -47,22 +68,16 @@ configure-options = ...@@ -47,22 +68,16 @@ configure-options =
-DCMAKE_C_FLAGS="${:CMAKE_CFLAGS}" -DCMAKE_C_FLAGS="${:CMAKE_CFLAGS}"
-DCMAKE_CXX_FLAGS="${:CMAKE_CFLAGS}" -DCMAKE_CXX_FLAGS="${:CMAKE_CFLAGS}"
-DCMAKE_INSTALL_PREFIX=@@LOCATION@@ -DCMAKE_INSTALL_PREFIX=@@LOCATION@@
-DCMAKE_INSTALL_RPATH=${:CMAKE_LIBRARY_PATH}:@@LOCATION@@/lib -DCMAKE_INSTALL_RPATH=${mavsdk-env:CMAKE_LIBRARY_PATH}:@@LOCATION@@/lib
-DPKG_CONFIG_EXECUTABLE=${pkgconfig:location}/bin/pkg-config -DPKG_CONFIG_EXECUTABLE=${pkgconfig:location}/bin/pkg-config
-DSUPERBUILD=OFF -DSUPERBUILD=OFF
-Bbuild/default -Bbuild/default
-H. -H.
make-binary = make-binary =
${:cmake} --build build/default --target install ${:cmake} --build build/default --target install
environment = environment = mavsdk-env
CMAKE_INCLUDE_PATH=${curl:location}/include:${jsoncpp:location}/include:${tinyxml2:location}/include
CMAKE_LIBRARY_PATH=${:CMAKE_LIBRARY_PATH}
CMAKE_PROGRAM_PATH=${cmake:location}/bin
PATH=${pkgconfig:location}/bin/:%(PATH)s
LDFLAGS=-L${curl:location}/lib -Wl,-rpath=${curl:location}/lib -L${jsoncpp:location}/lib -Wl,-rpath=${jsoncpp:location}/lib -L${tinyxml2:location}/lib -Wl,-rpath=${tinyxml2:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib -Wl,-rpath=@@LOCATION@@/lib
CMAKE_CFLAGS=-I${tinyxml2:location}/include CMAKE_CFLAGS=-I${tinyxml2:location}/include
CMAKE_LIBRARY_PATH=${curl:location}/lib:${jsoncpp:location}/lib:${tinyxml2:location}/lib:${zlib:location}/lib
[mavsdk-wrapper] [mavsdk-wrapper]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
......
# THIS IS NOT A BUILDOUT FILE, despite purposedly using a compatible syntax.
# The only allowed lines here are (regexes):
# - "^#" comments, copied verbatim
# - "^[" section beginings, copied verbatim
# - lines containing an "=" sign which must fit in the following categorie.
# - "^\s*filename\s*=\s*path\s*$" where "path" is relative to this file
# Copied verbatim.
# - "^\s*hashtype\s*=.*" where "hashtype" is one of the values supported
# by the re-generation script.
# Re-generated.
# - other lines are copied verbatim
# Substitution (${...:...}), extension ([buildout] extends = ...) and
# section inheritance (< = ...) are NOT supported (but you should really
# not need these here).
[message-definition]
filename = common.xml
md5sum = 741068d99c27594d9b655caf125169f3
...@@ -5577,13 +5577,18 @@ ...@@ -5577,13 +5577,18 @@
<field type="uint8_t" name="on_off">1 stream is enabled, 0 stream is stopped.</field> <field type="uint8_t" name="on_off">1 stream is enabled, 0 stream is stopped.</field>
</message> </message>
<message id="69" name="MANUAL_CONTROL"> <message id="69" name="MANUAL_CONTROL">
<description>This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled an buttons are also transmit as boolean values of their </description> <description>This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask</description>
<field type="uint8_t" name="target">The system to be controlled.</field> <field type="uint8_t" name="target">The system to be controlled.</field>
<field type="int16_t" name="x">X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle.</field> <field type="int16_t" name="x" invalid="INT16_MAX">X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle.</field>
<field type="int16_t" name="y">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="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">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="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">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="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' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1.</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>
<extensions/>
<field type="uint16_t" name="buttons2">A bitfield corresponding to the joystick buttons' 16-31 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 16.</field>
<field type="uint8_t" name="enabled_extensions">Set bits to 1 to indicate which of the following extension fields contain valid data: bit 0: pitch, bit 1: roll.</field>
<field type="int16_t" name="s">Pitch-only-axis, normalized to the range [-1000,1000]. Generally corresponds to pitch on vehicles with additional degrees of freedom. Valid if bit 0 of enabled_extensions field is set. Set to 0 if invalid.</field>
<field type="int16_t" name="t">Roll-only-axis, normalized to the range [-1000,1000]. Generally corresponds to roll on vehicles with additional degrees of freedom. Valid if bit 1 of enabled_extensions field is set. Set to 0 if invalid.</field>
</message> </message>
<message id="70" name="RC_CHANNELS_OVERRIDE"> <message id="70" name="RC_CHANNELS_OVERRIDE">
<description>The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels</description> <description>The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels</description>
...@@ -5707,6 +5712,8 @@ ...@@ -5707,6 +5712,8 @@
<field type="float" name="body_pitch_rate" units="rad/s">Body pitch rate</field> <field type="float" name="body_pitch_rate" units="rad/s">Body pitch rate</field>
<field type="float" name="body_yaw_rate" units="rad/s">Body yaw rate</field> <field type="float" name="body_yaw_rate" units="rad/s">Body yaw rate</field>
<field type="float" name="thrust">Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)</field> <field type="float" name="thrust">Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)</field>
<extensions/>
<field type="float[3]" name="thrust_body">3D thrust setpoint in the body NED frame, normalized to -1 .. 1</field>
</message> </message>
<message id="83" name="ATTITUDE_TARGET"> <message id="83" name="ATTITUDE_TARGET">
<description>Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way.</description> <description>Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way.</description>
...@@ -6178,6 +6185,9 @@ ...@@ -6178,6 +6185,9 @@
<field type="uint32_t" name="baudrate" units="bits/s">Baudrate of transfer. Zero means no change.</field> <field type="uint32_t" name="baudrate" units="bits/s">Baudrate of transfer. Zero means no change.</field>
<field type="uint8_t" name="count" units="bytes">how many bytes in this transfer</field> <field type="uint8_t" name="count" units="bytes">how many bytes in this transfer</field>
<field type="uint8_t[70]" name="data">serial data</field> <field type="uint8_t[70]" name="data">serial data</field>
<extensions/>
<field type="uint8_t" name="target_system">System ID</field>
<field type="uint8_t" name="target_component">Component ID</field>
</message> </message>
<message id="127" name="GPS_RTK"> <message id="127" name="GPS_RTK">
<description>RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting</description> <description>RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting</description>
......
...@@ -18,7 +18,7 @@ md5sum = 360b58007c25727b7bd8a9154d5cafd4 ...@@ -18,7 +18,7 @@ md5sum = 360b58007c25727b7bd8a9154d5cafd4
[instance-default] [instance-default]
filename = instance-default.cfg filename = instance-default.cfg
md5sum = 696ec3cc5c7bcda336b9bb68ef1555bd md5sum = 1daf69cb5d9fbb3753a117d5b87ef8a9
[instance-drone] [instance-drone]
filename = instance-drone.cfg filename = instance-drone.cfg
......
...@@ -30,7 +30,7 @@ config-numberOfDrone = {{ dumps(len(drone_guid_list)) }} ...@@ -30,7 +30,7 @@ config-numberOfDrone = {{ dumps(len(drone_guid_list)) }}
config-numberOfSubscriber = {{ dumps(len(subscriber_guid_list)) }} config-numberOfSubscriber = {{ dumps(len(subscriber_guid_list)) }}
config-id = {{ dumps(id) }} config-id = {{ dumps(id) }}
config-isASimulation = {{ dumps(is_a_simulation) }} config-isASimulation = {{ dumps(is_a_simulation) }}
{% if guid in drone_guid_list -%} {% if id < len(drone_guid_list) -%}
{% do drone_id_list.append(id) %} {% do drone_id_list.append(id) %}
config-isADrone = {{ dumps(True) }} config-isADrone = {{ dumps(True) }}
config-flightScript = {{ flight_script }} config-flightScript = {{ flight_script }}
......
...@@ -118,23 +118,22 @@ class JSDroneTestCase(SlapOSInstanceTestCase): ...@@ -118,23 +118,22 @@ class JSDroneTestCase(SlapOSInstanceTestCase):
def getInstanceParameterDict(cls): def getInstanceParameterDict(cls):
return { return {
'_': json.dumps({ '_': json.dumps({
'droneGuidList': [cls.slap._computer_id],
'netIf': OPC_UA_NET_IF, 'netIf': OPC_UA_NET_IF,
'subscriberGuidList': [cls.slap._computer_id], 'subscriberGuidList': [cls.slap._computer_id],
}) })
} }
def get_partition(self, instance_type): def get_partition(self, partition_id):
software_url = self.getSoftwareURL() software_url = self.getSoftwareURL()
for computer_partition in self.slap.computer.getComputerPartitionList(): for computer_partition in self.slap.computer.getComputerPartitionList():
partition_url = computer_partition.getSoftwareRelease()._software_release if computer_partition.getId() == partition_id:
partition_type = computer_partition.getType()
if partition_url == software_url and partition_type == instance_type:
return computer_partition return computer_partition
raise Exception("JS-drone %s partition not found" % instance_type) raise Exception("Partition %s not found" % partition_id)
def setUp(self): def setUp(self):
super().setUp() super().setUp()
subscriber_partition = self.get_partition('drone') subscriber_partition = self.get_partition('JSDroneTestCase-2')
instance_path = json.loads( instance_path = json.loads(
subscriber_partition.getConnectionParameterDict()['_'])['instance-path'] subscriber_partition.getConnectionParameterDict()['_'])['instance-path']
quickjs_bin = os.path.join(instance_path, 'bin', 'qjs') quickjs_bin = os.path.join(instance_path, 'bin', 'qjs')
...@@ -247,18 +246,18 @@ class JSDroneTestCase(SlapOSInstanceTestCase): ...@@ -247,18 +246,18 @@ class JSDroneTestCase(SlapOSInstanceTestCase):
def test_requested_instances(self): def test_requested_instances(self):
connection_parameter_dict = json.loads( connection_parameter_dict = json.loads(
self.computer_partition.getConnectionParameterDict()['_']) self.computer_partition.getConnectionParameterDict()['_'])
self.assertEqual(connection_parameter_dict['drone-id-list'], []) self.assertEqual(connection_parameter_dict['drone-id-list'], [0])
self.assertEqual(connection_parameter_dict['subscriber-id-list'], [0]) self.assertEqual(connection_parameter_dict['subscriber-id-list'], [1])
def test_subscriber_instance_parameter_dict(self): def test_subscriber_instance_parameter_dict(self):
self.assertEqual( self.assertEqual(
json.loads(self.get_partition('drone').getInstanceParameterDict()['_']), json.loads(self.get_partition('JSDroneTestCase-2').getInstanceParameterDict()['_']),
{ {
'autopilotIp': '192.168.27.1', 'autopilotIp': '192.168.27.1',
'autopilotPort': 7909, 'autopilotPort': 7909,
'numberOfDrone': 0, 'numberOfDrone': 1,
'numberOfSubscriber': 1, 'numberOfSubscriber': 1,
'id': 0, 'id': 1,
'isASimulation': False, 'isASimulation': False,
'isADrone': False, 'isADrone': False,
'flightScript': 'https://lab.nexedi.com/nexedi/flight-scripts/raw/master/subscribe.js', 'flightScript': 'https://lab.nexedi.com/nexedi/flight-scripts/raw/master/subscribe.js',
......
...@@ -186,6 +186,7 @@ Flask = 1.1.2 ...@@ -186,6 +186,7 @@ Flask = 1.1.2
frozenlist = 1.3.3:whl frozenlist = 1.3.3:whl
funcsigs = 1.0.2 funcsigs = 1.0.2
functools32 = 3.2.3.post2 functools32 = 3.2.3.post2
future = 0.18.3
gevent = 20.9.0 gevent = 20.9.0
geventmp = 0.0.1 geventmp = 0.0.1
gitdb = 4.0.10 gitdb = 4.0.10
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment