Clear Filters
Clear Filters

Gazebo HITL simulation with PX4 running embeded coder controller

6 views (last 30 days)
Hi,
So I've built a flight controller and uploaded it to the pixhawk. I want to test this with a HITL simulation before I run it on my drone. The project I am working on is an autonomous quadcopter. I have successfully tested some autonomous flights with the standard PX4 PID. When i did this the HITL simulation worked well with gazebo.
Now I have uploaded my own controller that i made on the PX4 hardware support package (embedded coder). When I launch the HITL simulation there is a connection to the gazebo model (i think at least since qground control connects) but i do not have control of the quad. Anouther thing to note is that the actual Pixhawk is controling the sensors, so when i rotate the board the sensor view in qground responds accordingly when it should only respond to the simulated drone. I assume the pixhawk is not actually booting to HITL mode here.
When trying to arm the quad or take off qground throws up an error saying the vehicle didnt respond to the command. I have been using the same set up as for the standard PID as i was hoping only the controller would be replaced and everything else would work the same.
I know there is a HITL mode in the PX4 support package but i cant use this as its only jmav simulator. This is a problem for me as i have a lot of ROS nodes that control the navigation and sensors on my drone.
Any help or advice would be appritiated here i've been trying for weeks. Has anyone had this issue?
  1 Comment
fatih ozkan
fatih ozkan on 9 Jun 2022
Edited: fatih ozkan on 9 Jun 2022
Hello Sir,
I am tring to simulate PX4 in SITL for testing my algorthms (with Another UAV model which i created). But couldn't find out how to open Gazebo with Simulink, how did u handle it?
I would be appreciated if you help.
Thanks.

Sign in to comment.

Answers (0)

Products


Release

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!