Changing VOXL2 DSP PX4 Orientation
-
@msberk Yes, when mounting the board in a different orientation the IMU driver needs to know the rotation. So, for example, we have one model of drone that has the board rotated by 180 degrees. So the start line for the imu driver adds
-R 4
to specify that (qshell icm42688p start -s -R 4
). The number 4 comes from the filesrc/lib/conversion/rotation.h
and corresponds toROTATION_YAW_180
. For your case I think you would want to specify-R 8
forROTATION_ROLL_180
. -
@Eric-Katzfey
Ok, that worked. Thanks!How would you advise setting it up to run at boot? I found the target script here but it's set up differently than a typical Pixhawk board target.
-
@msberk There are different ways to go about starting px4. What we do is use the voxl-px4 script to launch everything (In that same target directory). That can be be used in a systemd service file to launch px4 at board startup. That script has command line options that control certain features. Ultimately px4 is passed that voxl-px4.config script using the
-s
option. Both voxl-px4 and voxl-px4.config are bash scripts which makes them quite flexible. For a different perspective you can look at our voxl-px4 gitlab project which acts as a wrapper for px4 and creates a debian package that can be installed on target. The package will place all needed files in the correct places during installation and has a voxl-px4.service file example for systemd startup. (https://gitlab.com/voxl-public/voxl-sdk/services/voxl-px4/-/tree/dev) -
from where can add this command?
it is not clear. If you can clarify more about the process
thank you
-
@Abdullah01 In voxl-px4 1.12.31 you can find all of the PX4 startup commands in /etc/modalai/voxl-px4.config.
-
Great thank you.
I checked the file and the imu is already rotated as you can see in the picture
But when I start the calibration process and face the drone's nose upward. it shows that it faces downward
should I make the changes on the config file and on QGC? or just on the file?
thank you
-
Now It works with the correct orientation.
But there are two issues,
1- Once I complete the compass calibration process, and restart the voxl/drone. it shows me that the calibration process has not been done and I need to re-calibrate again.
2- the accelerometer calibration process keeps crashing and it shows this message
-
@Abdullah01 It still seems like your rotation is not setup correctly. Have you set SENS_BOARD_ROT to anything? Did you change the imu start line to have a rotation of 8 instead of 4?
-
I just tried to change it from 4 to 8 but nothing changed.
Yes, I changed the SENS_BOARD_ROT to Yaw 180 degrees
-
@Abdullah01 Leave SENS_BOARD_ROT as the default value. You are specifying the rotation of the board by giving the IMU driver the
-R 4
option.