# A Problem on Controlling Pixhawk with Raspberry Pi 4B

**URL:** <https://discuss.px4.io/t/a-problem-on-controlling-pixhawk-with-raspberry-pi-4b/34325>\
**Category:** PX4 Autopilot\
**Created:** [September 16, 2023, 1:21pm UTC](https://discuss.px4.io/t/a-problem-on-controlling-pixhawk-with-raspberry-pi-4b/34325 "2023-09-16T13:21:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ning](https://discuss.px4.io/letter_avatar_proxy/v4/letter/n/b5e925/32.png) [@ning](https://discuss.px4.io/u/ning)\
**Post date:** [September 16, 2023, 1:21pm UTC](https://discuss.px4.io/t/a-problem-on-controlling-pixhawk-with-raspberry-pi-4b/34325/1 "2023-09-16T13:21:25Z")

</div>

Hello everyone，

I use Raspberry Pi 4B to issue commands to control the drone’s fixed point flight, and use offboard mode. In addition, I installed a camera on the drone and wanted to recognize the logo and fly towards it. Therefore, I customized a message(“Marker\_Deviation.msg”) about the coordinates of the logo and published it through ROS. I have added code to receive this message in the official offboard codes.

But there was a problem.I can execute code related to offsboard control and successfully receive custom information.I can execute code related to offboard control and successfully receive custom information. But my drone is unable to enter offboard mode and the buzzer sounds ’ Notify Negative Tone '.There is nothing displayed in my QGC, I want to check the flight log, but there is nothing.

![屏幕截图 2023-09-16 205631](https://discuss.px4.io/uploads/default/original/2X/8/8fad2865f092ebcbd88eca08b78c90b89fcbb3dc.png)

When I removed the code related to receiving “Marker\_Deviation.msg”, the drone could enter offboard mode normally and successfully take off. I don’t know why adding custom information would affect my control of drones. I hope to receive your help. I would like to express my gratitude in advance here.

The following is a code image related to “Marker\_Deviation.msg” information. When I remove this part of the code, the drone can take off normally。

 ![屏幕截图 2023-09-16 211519](https://discuss.px4.io/uploads/default/original/2X/6/66245453dbda6583169799790dd4f88682f0bd63.png)  
 ![屏幕截图 2023-09-16 211533](https://discuss.px4.io/uploads/default/original/2X/9/9ab16c24f8235a5d74c11ccd688329670245809b.png)

The custom message is shown in the figure:  
 ![屏幕截图 2023-09-16 211619](https://discuss.px4.io/uploads/default/original/2X/3/35c56fc7871a73c81c100d01b6610b59e1086773.png)

The control code is as follows：  
/\*\*

- @file offb\_node.cpp

- @brief Offboard control example node, written with MAVROS version 0.19.x, PX4 Pro Flight

- Stack and tested in Gazebo SITL  
\*/
