Controlling a Pixhawk over Raspberry

Dear all

How can one set up a pixhawk and a raspberry pi, so that the pixhawk accepts a target heading command from a raspberry?

The rapsberry is running computer vision software, and can recognize a row of obstacles, and can tell the heading of the “free path” w.r.t. the normal axis to the Camera’s vision plane.

I want, that the pixhawk accepts this heading, and adjusts a rover’s yaw accordingly. How can we do that? Which parameters are critical.

Thank you

This link is not for raspberry pi, but i refered to it to make my raspberry pi work, but performance of my reaspberry pi is not good. https://risc.readthedocs.io/1-indoor-flight.html

In addition to the link Haijie-Zhang posted which tells you about the software connection via mavros - this link from ardupilot is great in terms of doing the hardware connection:
http://ardupilot.org/dev/docs/raspberry-pi-via-mavlink.html
But what I have realized is that the 5V output of the pixhawk might not be enough for your Pi - so I recommend an power supply on its own, f.e. I connected my battery to the pixhawk system and via a 5V-Converter also to the raspberry.

How can one set up a pixhawk and a raspberry pi, so that the pixhawk accepts a target heading command from a raspberry?

I would suggest looking into a ros/mavros system - this is what I am using and it runs well. Having the rosmaster on the pi and the possibility to connect via ssh on your wifi is very practical. Once the mavros is running and your connection to the pixhawk is working you can have a look in the offboard control
https://dev.px4.io/v1.9.0/en/ros/mavros_offboard.html
to send commands to your drone/rover.

I want, that the pixhawk accepts this heading, and adjusts a rover’s yaw accordingly. How can we do that? Which parameters are critical.

If you get your yaw of vision software you should be able to set it via a custom velocity control in your offboard node - working with these velocity needs somekind of worldmap/odometry to run because the velocities are in the world system and not your drone system.
geometry_msgs::Twist velo_control;
velo_control.linear.x=...;// planar movement in world coordinates
velo_control.linear.y=...; // planar movement in world coordinates
velo_control.linear.z=0; // to hold height or skip for rovers I guess
velo_control.angular.z= ... ; // changes in rad depending on your program
velo_pub.publish(velo_control); // publish on topic "mavros/setpoint_velocity/cmd_vel_unstamped"

Kind regards