Offboard control - Attitude setpoint- Actual Flight

Hello !
I have performed offboard control in SITL as well as HITL. Now I want to perform it on actual hardware. I looked into different sources, but am unable to figure out things myself.

Please note:

  1. I am using Pixhawk 1.8 and Raspberry pi. Current connections are according to link.
  2. I only changed sys-companion to “57600 companion link” in QGC. I chose 57600 baud rate since UART of raspberry pi only supports 57600.
  3. I am commanding a roll_sp which I see in QGC, However the motor speeds are not changing at all.

Following this I just launch mavros and run my offboard node. However I don’t see any effect of my desired attitude.
Any help is appreciated. Thank you very much for your time on this.

@Vrinda Sounds like it is rejecting offboard. Do you have any error messages from the flight controller?

One more note: which raspberry pi are you using? I am quite sure you can do higher baudrates even with the raspberry pi zero

Hello @Jaeyoung-Lim !
It is not rejecting offboard mode. QGC calls out “offboard mode” when I run my launch file. However I don’t see any effect.
I am using raspberry Pi 3 B. But I don’t have a FTDI cable. Is it fine to use high baud rate for the uart port of my Pi ?
Thanks much ! : )


Did you look into what you are publishing into the setpoint message?

It also depends on which RPi3 you have, but mostly 115200 is acheivable and even up to 921600. This also depends on your hardware setup for example if your serial cable is too long it might have packetloss for higher baudrates.

Yes @Jaeyoung-Lim !

  1. I am publishing a roll setpoint of 0.3 radians and I see it in QGC.
  2. I will look into my Pi specifications. I have soldered jumper wires to a serial cable. I will post a picture as soon as I get chance.
    However is my procedure right ? The only parameter I touch in QGC is sys_companion right ?

Hi, Virnda

In QGC, there is no offboard mode related parameter SYS_COMPANION, and the baudrate is 57600, which is sufficient for the test

@jhlee SYS_COMPANION is used up to px4 1.8.1.

Yes I am using Pixhawk 1.8, probably that is why…

Hello everyone !
I got it to work. I don’t know what was the problem. There is one weird thing I see though. There is yaw drift only in the beginning for few seconds. The quadcopter suddenly yaws over 60 degrees initially. Please can someone help me take care of this.
Thank you !

@Vrinda Have you checked if your initial orientation is aligned with the inertial frame?

I aligned it. It works now @Jaeyoung-Lim ! Thanks much ! One question. How do you know the inertial frame ? I came to know after I did the first test. I aligned my quad to the point where yaw was stopping.

You should be able to see it on the tf messages with rviz. Does it mean the issue is solved if attitude is aligned?

“tf messages with rviz”…how to do that ?

I will check again, am not confident.

@Vrinda You can learn how to use rviz here

Hello @Jaeyoung-Lim ! I am kind of familiar with rviz. Oh do you mean, I click frame as inertial in rviz and see the alignment ?

Hello @Jaeyoung-Lim !
I have been testing since then in my lab. Now I plan to test outdoors. I need your help regarding this direction problem. So my system works when the quad’s front is pointing towards the east direction. I checked rviz, with map as my fixed frame and plotted /mavros/local_position/pose and saw that in east direction the error between the fixed frame and pose was not there. Please let me know if am on right track or if am doing anything incorrectly. So now I know the direction in which my quad works. Please note, as soon as I change the direction, I don’t get good results in attitude controller. Now I want to get rid of this problem such that I should be able to fly in any direction I keep the system. Please can you guide me regarding this as per your time ?
Thanks much !