Offboard control - Attitude setpoint- Actual Flight

#1

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.

#2

@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

#3

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 ! : )

#4

@Vrinda

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.

#5

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 ?
#6

Hi, Virnda

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

#7

@jhlee SYS_COMPANION is used up to px4 1.8.1.

#8

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

#9

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 !

#10

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

#11

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.

#12

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

#13

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

I will check again, am not confident.

#14

@Vrinda You can learn how to use rviz here

#15

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 ?