Is the offboard mode and mavros needed to be used together?

Hello, I run the posix_sitl_default of px4 on my computer, I want to use ros to control px4, so I use mavros.
From the example code on this page (, I find the control mode of px4 is OFFBOARD mode.
I want to know, whether I have to use OFFBOARD mode if I want to control with mavros?
And is there any other way to connect ros and px4?
Thanks a lot.

Yes, you must use OFFBOARD to control from mavros “companion computer”