Last week, I discussed that I fixed the issue with using QuadcopterLogic functions that would cause the system to crash. My issue stemmed from trying to call the GetTelemetry function without calling the Run function first. This revelation also fixed my issue with trying to call the GetMotorSpeeds function from QuadcopterLogic. I also explained that I was having issues trying to subscribe to radio messages produced by quad_mocap_rates_controller and when I would start the controller, a seg fault would occur.
I have fixed my subscriber issue by using classes from the Subscriber Options namespace. Next, I focused on making the Gazebo model hover. Initially the model was not responding to the motor commands from our logic, but this was easily fixed by changing the rostopic name that is published from RotorS. The model now responds to our logic’s motor speed commands. The physical properties for the Gazebo model used and the quadcopters in QuadcopterConstants are not the same, so the simulation did not respond as expected (i.e. the model overshot the set point of 2 meters).
My plan this week is to change the physical parameters of the Gazebo model to mimic those in the Quadcopter constants file for a more accurate simulation. I will also look further into how to create models in Gazebo for structures and sensors.