Cannot enable MOCAP on Pixhawk

Hello,

I’m currently working on a hexacopter and wanted to use Mocap instead of the regular IMU readings, but when I tried following the detailed guide about fake gps in the developer guide, I had a few issues:

Namely, I cannot find the following parameters in any of the suggested places: 1) ATT_EXT_HDG_M, 2) INAV_DISAB_MOCAP.

I also cannot change the paramter SYS_COMPANION to the suggested “magic mode” of 257600, due to the drop down list.

I am using the most recent QGroundControl developer build and flashed the most up-to-date firmware on the Pixhawk. Any ideas?

Thanks,
Omar

(see https://dev.px4.io/advanced-fake-gps.html)

Hello once again,

Good news! I now know the reason why I could not find these parameters. The pixhawk apps for them (attitude_estimator_q and local_position_estimator) were disabled in the build of px4fmu-v2. This made me stumble on the post about the same problem here on the PX4 Discuss if anyone is facing a similar problem:

Omar

Hello,

I am facing the same issue right now. Have you been able to solve this ?. Are there some parameters that need to be enabled? If so could you tell me which ?.

Thank you,
RS

Hey,

What you need to do is go to Firmware/cmake/configs and change the nuttx_px4fmu_v2_default.cmake if using make px4fmu_v2. This file decides which applications are built, and you need to enable the estimator modules 1) local position estimator and 2) attitude_estimator_q , while removing ekf2 (comment it). This should enable you to find the missing parameters.

Make sure to then change ALL the parameters as entailed on the dev guide , apparently disbling barometric fusion is essential. Good luck

Dear @Ramomrito @rs1990,

For the 1.5 version, LPE is not compiled (you can’t switch from EKF2 to LPE).

For the 1.6RC1 Firmware, you can enable LPE by uploading the “LPE enabled” firmware.

  • Download the zip file
  • Extract the lpe firmware
  • Update the Pixhawk Firmware by pressing “advanced settings” then “custom firmware” and select the lpe firmware.

I am developing a project similar to six optitrack cameras, after activating the mocap option, how can I disable the gps?

Are you using mavros?
If I want to use fake gps, do I have to use a Raspberry or other board?

My lab has six cameras and two computers (Windows and Ubuntu)

I wait your answer, regards

Refer to the dev guide (dev.px4.io) and look at the fake gps section. Yes, I use mavros because it already has plugins to send VICON or Optitrack transform messages to the Pixhawk.

In the worst case you have to change some configs (yaml files), but it should be fine.

If you have a 3DR Radiometry set you do not need an onboard computer, unless of course you need one for additional onboard applications. Refer for pixhawk companion computer for that (also in dev guide).

The GPS is integrated into the Position Estimator.

If you are using MOCAP, then you need to use LPE (Firmware 1.6.0+, LPE version).

Then, in the LPE parameters, you can see the LPE_GPS_xxx parameter.

I used to use custom made app that gets mocap data, then transmits it via telemetry module (Xbee). It worked fine with versions 1.5.1 to 1.5.5 with LPE, but I had to increase the transmission frequency to 50Hz, which is weird. Usually 10Hz is enough, but I was getting ‘mocap timeout’ message very frequently.

The mavros solution, however, never worked for me. I mean, I can use the mocap mavros plugin to send mocap data, but always getting '‘mocap timeout’ message, no matter how I increase the frequency.

I have not tried v1.6.0 yet, or master. Maybe it’s fixed i latest master version.

Did you ever tried to reduce the mocap frequency ?

I had timeouts with 30Hz, but stable at 7Hz. No idea why.

Hi, I am doing the same tutotrial (fake gps), right now I have the following:

1.- The comunication between my windows pc and Ubuntu pc (ROS): I am using vrpn
2.- The communication between mavros and Iris drone: I am using two telemetry in the port (TELEM1) with boudrate 57600

In the pixhawk setup: I am usin the firmwere 1.5.5 and eneable the LPE estimator and mocap.

Mi problem is: When I am in the LPE parameters tab, i want disable barometer fusion and this option not appear, I can’t find LPE_FUSION in the QGC.

why i don’t find LPE_FUSION?

Greetings.

Hey Mario,

I also realized this when I switched to stable branch, the parameter simply does not exist there. You will only find it if you flash master instead.

And the good news is you do not need it, the mocap should work fine.

May be a stupid question but what do you mean by “flash master”?

thanks for answering

Master is the very latest branch, usually filled with the more experimental features that are not yet completely stable and suitable for reliable flight. This is what you clone directly from github.

If you follow the ‘Build the code’ part in the devguide you basically use that Firmware version 1.6.*

‘Flashing’ is the act of uploading the Firmware to the Pixhawk

Thanks for the help, your answers have helped me a lot, I have another question,

I am using vrpn to transmit the position data from motive (optitrack) to ROS, then the data of the node vrpn I have to send to mocap_pose_estimate plugin. my question is:

How to use the mocap_pose_estmate plugin?

When I start the mavros node and look in “rostopic list” I do not see topic mocap

I personally do not use the vrpn so I don’t know how that works. I use vicon_bridge package (VICON system) instead.

In terms of the plugin, the way the Mavros package works is that you launch the mavros node and it automatically loads a list of plugins and runs them in the background. This list of plugins can be configured with the mavros_plugins.xml file.

The mocap one should be in there by default, are you sure you don’t see the topic /mavros/mocap/pose?
What you need to do anyway is remap the Mocap data from the Optitrack to that same topic. This is what the plugin listens to.

Hope this helps.

thanks! @Ramomrito

I Reinstall mavros and appeared the topic /mavros/mocap/pose, my situation is as follows:

The vrpn node contains the position data of the optitrack cameras, I suppose that I have to send this data to mocap/pose topic.

What is remap mocap data?

How is it done?

Thanks for helping.