hello all,
i am using pixhawk 6c mini (uploaded autopilot version px4 v1.15) and raspberry pi as companian computer. i dont use gps. i use optical flow and tf-03 which is published in raspberry pi with ros2.
when i give a trajectory x and y drones height is reduced while it goes to the point. even it sometimes touches the ground. so for instance i will share a graphic. this graphic contains distance sensor [current distance], vehicle odometry [position z], trajectory setpoint [position z].
i was suspecting if trajectory setpoint z is reduced but it is always in the same value. so i started to suspect about barometer. i wonder if barometer affect this problem.
here is the flight log: https://review.px4.io/plot_app?log=7207702f-978c-4716-a085-ba166e31d8ac
how to solve this problem?
Did you account for gravity in your offboard?
9.2 something force…
i guess no. how can i do that?
How is your offboard setup works ? What code?
well, i just set a TrajectorySetpoint object inside a function.
void publishTrajectorySetpoint()
{
trajectorySetpointMsg msg{};
msg.position[0] = setpoint.position.x;
msg.position[1] = setpoint.position.y;
msg.position[2] = -setpoint.position.z;
msg.velocity[0] = setpoint.velocity.x;
msg.velocity[1] = setpoint.velocity.y;
msg.velocity[2] = setpoint.velocity.z;
msg.yaw = setpoint.attitude.yaw; // [-PI:PI]
msg.timestamp = this->get_clock()->now().nanoseconds() / 1000;
pub.trajectory_setpoint->publish(msg);
}
// this enables offboard control
void publishOffboardControlMode()
{
offboardControlModeMsg msg{};
msg.position = true;
msg.velocity = false;
msg.acceleration = false;
msg.attitude = false;
msg.body_rate = false;
msg.direct_actuator = false;
msg.timestamp = this->get_clock()->now().nanoseconds() / 1000;
pub.offboard_control_mode->publish(msg);
}
opened 07:26AM - 30 Nov 24 UTC
bug-report
### Describe the bug
We are using an ARK Pi6xFlow without GPS and are trying … to reliable takeoff to 2 meters.
We use both EKF2_BARO_CTRL as EKF2_RNG_CTRL and the HGT_REF is set to barometric.
When taking off, sometimes it goes to 2m, but most of the time to somewhere between 3 and 5.
Using 1.16.0 alpha, the height was around 1m
### To Reproduce
1. Drone switched on
2. Armed
3. Takeoff to 2m command issued
4. Measure physical distance as soon as the height seem stable)
### Expected behavior
Go to the correct height (more or less since exact would be impossible off course)
### Screenshot / Media
_No response_
### Flight Log
barometric hgt ref (result 3.2m): https://review.px4.io/plot_app?log=514ae575-9d2e-4687-ab55-6e8836979b02
Range hgt ref (result 2m) https://review.px4.io/plot_app?log=b3753550-44ac-439a-905b-933f7a3932c3
Using 1.16.0 alpha : https://review.px4.io/plot_app?log=8122ff4b-e309-41f5-9257-55d74abbdb5d
### Software Version
release 1.15.0 stable
One test with 1.16.0 alpha
### Flight controller
ARK Pi6xFlow board (Dexi Airframe from DroneBlocks)
### Vehicle type
Multicopter
### How are the different components wired up (including port information)
ARK board to ESC to Motors.
Pi CM4 on ark-board, using MicroUXCREAgent to transform UORB to ROS2 topics.
RC and a LED ring are connected to the ARK board as well
### Additional context
After takeoff, the height should remain stable, regardless of what the terrain is doing.
That's why we want to use barometric height reference, since a distance sensor will cause problems.
We're also adding VIO using markers, but don't believe that this would be more reliable then a barometer
@Patrik_Pordi1 is working on this right now with @bresch
1 Like