PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.5k stars 13.51k forks source link

Type of file airframe + error when building code UnicodeEncodeError: 'ascii' codec can't encode character '\xea' in position 38: ordinal not in range(128) #11585

Closed guroz closed 5 years ago

guroz commented 5 years ago

Good evening,

I am new to px4 and I encountered an issue when trying to build a new airframe (following the tutorial https://dev.px4.io/en/airframes/adding_a_new_frame.html). The added airframe is :

#!nsh
#

# @name prao
#

# @type Flying Wing
# @class Plane
#

# @maintainer Johan Poccard <johan.poccard-saudart@epfl.ch>
#

# @output MAIN1 rudder
# @output MAIN2 main foil
# @output MAIN3 small foil
# @output MAIN4 throttle
#

# @output AUX A DEFINIR
#

sh /etc/init.d/rc.fw_defaults // peut-être besoin de créer un nouveau fichier defaults

if [$AUTOCNF = yes]
then
 param set FW_AIRSPD_MAX 10 //recopié du bifoiler
 param set FW_AIRSPD_MIN 3
 param set FW_AIRSPD_TRIM 5
 param set FW_ATT_TC 0.3
 param set FW_L1_DAMPING 0.74
 param set FW_L1_PERIOD 16
 param set FW_LND_ANG 15
 param set FW_LND_FLALT 5
 param set FW_LND_HHDIST 15
 param set FW_LND_HVIRT 13
 param set FW_LND_TLALT 5
 param set FW_THR_LND_MAX 0
 param set FW_PR_FF 0.35
 param set FW_PR_IMAX 0.4
 param set FW_PR_P 0.08
 param set FW_RR_FF 0.6
 param set FW_RR_IMAX 0.2
 param set FW_RR_P 0.04
 param set SYS_COMPANION 157600
 param set PWM_MAIN_REV0 1
 param set PWM_MAIN_REV1 1
 param set PWM_DISARMED 0
 param set PWM_MIN 1000
 param set PWM_MAX 2000
fi

//Configure this as fixed wing
set MAV_TYPE 1

//Set mixer
set MIXER prao

//PWM
set PWM_DISARMED p:PWM_DISARMED
set PWM_MIN p:PWM_MIN
set PWM_MAX p:PWM_MAX`

And the mixer associated is : 

# `PRAO mixer
Designed for EPFL PRAO

This file defines mixers suitable for controlling a prao boat suing PX4.
Inputs to the mixer come from channel group 0 (vehicule attitude), channel 0 (roll),
1 (pitch), 2 (yaw) and 3 (thrust).

## Motor speed mixer
Two scalers total ( output, thrust)

This mixer generates a full-range output (-1 to 1) from an input in the (0 - 1)
range. Inputs below zero are treated as zero.

M: 1
O: 10000 10000 0 -10000 10000
S: 0 3 10000 10000 0 -10000 1000

## Rudder mixer
Two scalers total (output, yaw).

The mixer is configure as a pass throught.

M: 1
O: 7040 7040 0 -5000 5000
S: 0 2 10000 10000 0 -10000 1000

## Main foil mixer
Two scalers total (output, pitch).

The mixer is configure as a pass through.

M: 1
O: 10000 10000 0 -10000 10000
S: 0 1 10000 10000 0 -10000 10000

## Small foil mixer
Two scalers total (output, roll).

The mixer is configure as a pass through.

M: 1
O: 10000 10000 0 -10000 10000
S: 0 0 10000 10000 0 -10000 10000`

I have 2 main questions :

  1. I am not sure of the type the new airframe should be in. I just added a file without a type, is that how it should be done ?
  2. When building using make px4_fmu-v3_default I have the following error : `-- PX4 config file: /Users/guillaumerozand/Documents/EPFL/MASTER2/ControlePRAO/GITHUB_PX4/Firmware/boards/px4/fmu-v3/default.cmake -- PX4 config: px4_fmu-v3_default -- PX4 platform: nuttx -- PX4 lockstep: disabled -- PX4 version: v1.9.0-beta1-252-g97326ddc9d -- cmake build type: MinSizeRel -- The CXX compiler identification is GNU 7.3.1 -- The C compiler identification is GNU 7.3.1 -- The ASM compiler identification is GNU -- Found assembler: /usr/local/bin/arm-none-eabi-gcc -- Check for working CXX compiler: /usr/local/bin/arm-none-eabi-g++ -- Check for working CXX compiler: /usr/local/bin/arm-none-eabi-g++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Check for working C compiler: /usr/local/bin/arm-none-eabi-gcc -- Check for working C compiler: /usr/local/bin/arm-none-eabi-gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Found PythonInterp: /anaconda3/bin/python (found version "3.7") -- Found PY_jinja2: /anaconda3/lib/python3.7/site-packages/jinja2

-- PX4 ECL: Very lightweight Estimation & Control Library v0.9.0-647-g1378ec1 -- Building and including px4_io-v2_default -- Using C++11 -- Release build type: MinSizeRel -- Adding UAVCAN STM32 platform driver CMake Warning (dev) at platforms/nuttx/CMakeLists.txt:76 (target_link_libraries): Policy CMP0079 is not set: target_link_libraries allows use with targets in other directories. Run "cmake --help-policy CMP0079" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

Target

nuttx_arch

is not created in this directory. For compatibility with older versions of CMake, link library

drivers_board

will be looked up in the directory in which the target was created rather than in this calling directory. This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at platforms/nuttx/CMakeLists.txt:76 (target_link_libraries): Policy CMP0079 is not set: target_link_libraries allows use with targets in other directories. Run "cmake --help-policy CMP0079" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

Target

nuttx_arch

is not created in this directory. For compatibility with older versions of CMake, link library

drivers_arch

will be looked up in the directory in which the target was created rather than in this calling directory. This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at platforms/nuttx/CMakeLists.txt:76 (target_link_libraries): Policy CMP0079 is not set: target_link_libraries allows use with targets in other directories. Run "cmake --help-policy CMP0079" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

Target

nuttx_arch

is not created in this directory. For compatibility with older versions of CMake, link library

drivers_boards_common

will be looked up in the directory in which the target was created rather than in this calling directory. This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at platforms/nuttx/CMakeLists.txt:76 (target_link_libraries): Policy CMP0079 is not set: target_link_libraries allows use with targets in other directories. Run "cmake --help-policy CMP0079" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

Target

nuttx_arch

is not created in this directory. For compatibility with older versions of CMake, link library

drivers_boards_common_arch

will be looked up in the directory in which the target was created rather than in this calling directory. This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at platforms/nuttx/CMakeLists.txt:84 (target_link_libraries): Policy CMP0079 is not set: target_link_libraries allows use with targets in other directories. Run "cmake --help-policy CMP0079" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

Target

nuttx_c

is not created in this directory. For compatibility with older versions of CMake, link library

nuttx_drivers

will be looked up in the directory in which the target was created rather than in this calling directory. This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at platforms/nuttx/CMakeLists.txt:85 (target_link_libraries): Policy CMP0079 is not set: target_link_libraries allows use with targets in other directories. Run "cmake --help-policy CMP0079" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

Target

nuttx_xx

is not created in this directory. For compatibility with older versions of CMake, link library

nuttx_c

will be looked up in the directory in which the target was created rather than in this calling directory. This warning is for project developers. Use -Wno-dev to suppress it.

-- ROMFS: px4fmu_common -- ROMFS: Adding rc.board_defaults -- ROMFS: Adding rc.board_sensors -- Configuring done -- Generating done -- Build files have been written to: /Users/guillaumerozand/Documents/EPFL/MASTER2/ControlePRAO/GITHUB_PX4/Firmware/build/px4_fmu-v3_default ninja: Entering directory `/Users/guillaumerozand/Documents/EPFL/MASTER2/ControlePRAO/GITHUB_PX4/Firmware/build/px4_fmu-v3_default' [0/1141] git submodule platforms/nuttx/NuttX/nuttx [1/1141] git submodule platforms/nuttx/NuttX/apps [2/1141] git submodule src/lib/ecl [3/1141] git submodule src/drivers/uavcan/libuavcan [6/1141] git submodule src/drivers/gps/devices [13/1141] git submodule mavlink/include/mavlink/v2.0 [336/1141] Performing configure step for 'px4io_firmware' -- PX4 config file: /Users/guillaumerozand/Documents/EPFL/MASTER2/ControlePRAO/GITHUB_PX4/Firmware/boards/px4/io-v2/default.cmake -- PX4 config: px4_io-v2_default -- PX4 platform: nuttx -- PX4 lockstep: disabled -- PX4 version: v1.9.0-beta1-252-g97326ddc9d -- cmake build type: MinSizeRel -- The CXX compiler identification is GNU 7.3.1 -- The C compiler identification is GNU 7.3.1 -- The ASM compiler identification is GNU -- Found assembler: /usr/local/bin/arm-none-eabi-gcc -- Check for working CXX compiler: /usr/local/bin/arm-none-eabi-g++ -- Check for working CXX compiler: /usr/local/bin/arm-none-eabi-g++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Check for working C compiler: /usr/local/bin/arm-none-eabi-gcc -- Check for working C compiler: /usr/local/bin/arm-none-eabi-gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Found PythonInterp: /anaconda3/bin/python (found version "3.7") -- Found PY_jinja2: /anaconda3/lib/python3.7/site-packages/jinja2

-- PX4 ECL: Very lightweight Estimation & Control Library v0.9.0-647-g1378ec1 CMake Warning (dev) at platforms/nuttx/CMakeLists.txt:76 (target_link_libraries): Policy CMP0079 is not set: target_link_libraries allows use with targets in other directories. Run "cmake --help-policy CMP0079" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

Target

nuttx_arch

is not created in this directory. For compatibility with older versions of CMake, link library

drivers_board

will be looked up in the directory in which the target was created rather than in this calling directory. This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at platforms/nuttx/CMakeLists.txt:76 (target_link_libraries): Policy CMP0079 is not set: target_link_libraries allows use with targets in other directories. Run "cmake --help-policy CMP0079" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

Target

nuttx_arch

is not created in this directory. For compatibility with older versions of CMake, link library

drivers_arch

will be looked up in the directory in which the target was created rather than in this calling directory. This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at platforms/nuttx/CMakeLists.txt:76 (target_link_libraries): Policy CMP0079 is not set: target_link_libraries allows use with targets in other directories. Run "cmake --help-policy CMP0079" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

Target

nuttx_arch

is not created in this directory. For compatibility with older versions of CMake, link library

drivers_boards_common

will be looked up in the directory in which the target was created rather than in this calling directory. This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at platforms/nuttx/CMakeLists.txt:76 (target_link_libraries): Policy CMP0079 is not set: target_link_libraries allows use with targets in other directories. Run "cmake --help-policy CMP0079" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

Target

nuttx_arch

is not created in this directory. For compatibility with older versions of CMake, link library

drivers_boards_common_arch

will be looked up in the directory in which the target was created rather than in this calling directory. This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at platforms/nuttx/CMakeLists.txt:84 (target_link_libraries): Policy CMP0079 is not set: target_link_libraries allows use with targets in other directories. Run "cmake --help-policy CMP0079" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

Target

nuttx_c

is not created in this directory. For compatibility with older versions of CMake, link library

nuttx_drivers

will be looked up in the directory in which the target was created rather than in this calling directory. This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at platforms/nuttx/CMakeLists.txt:85 (target_link_libraries): Policy CMP0079 is not set: target_link_libraries allows use with targets in other directories. Run "cmake --help-policy CMP0079" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

Target

nuttx_xx

is not created in this directory. For compatibility with older versions of CMake, link library

nuttx_c

will be looked up in the directory in which the target was created rather than in this calling directory. This warning is for project developers. Use -Wno-dev to suppress it.

-- Configuring done -- Generating done -- Build files have been written to: /Users/guillaumerozand/Documents/EPFL/MASTER2/ControlePRAO/GITHUB_PX4/Firmware/build/px4_fmu-v3_default/external/Build/px4io_firmware [491/1141] Performing build step for 'px4io_firmware' [0/198] git submodule platforms/nuttx/NuttX/nuttx [1/198] git submodule platforms/nuttx/NuttX/apps [198/198] Creating /Users/guillaumeroz...d/px4io_firmware/px4_io-v2_default.px4 [1133/1141] ROMFS: pruning FAILED: ROMFS/romfs_pruned.stamp cd /Users/guillaumerozand/Documents/EPFL/MASTER2/ControlePRAO/GITHUB_PX4/Firmware/build/px4_fmu-v3_default/ROMFS && /anaconda3/bin/python /Users/guillaumerozand/Documents/EPFL/MASTER2/ControlePRAO/GITHUB_PX4/Firmware/Tools/px_romfs_pruner.py --folder /Users/guillaumerozand/Documents/EPFL/MASTER2/ControlePRAO/GITHUB_PX4/Firmware/build/px4_fmu-v3_default/genromfs --board px4_fmu-v3 && /usr/local/Cellar/cmake/3.13.4/bin/cmake -E touch romfs_pruned.stamp Traceback (most recent call last): File "/Users/guillaumerozand/Documents/EPFL/MASTER2/ControlePRAO/GITHUB_PX4/Firmware/Tools/px_romfs_pruner.py", line 120, in main() File "/Users/guillaumerozand/Documents/EPFL/MASTER2/ControlePRAO/GITHUB_PX4/Firmware/Tools/px_romfs_pruner.py", line 114, in main f.write(pruned_content.encode("ascii", errors='strict')) UnicodeEncodeError: 'ascii' codec can't encode character '\xea' in position 38: ordinal not in range(128) [1134/1141] Generating ../gencromfs ninja: build stopped: subcommand failed. make: *** [px4_fmu-v3_default] Error 1` How can I make it work ?

Thank you in advance for your answer.

hamishwillee commented 5 years ago

The error is exactly what it says - somewhere in your text you have a unicode character. The file format only supports ASCII. It is probably some accent character that isn't part of the standard set for English.

You will need to strip it out. What might work is using a tool like this: https://onlineasciitools.com/convert-unicode-to-ascii

guroz commented 5 years ago

Thank you very much !