Getting MOCAP data into PX4

  1. Please refer to the MOCAP-ROS interface tutorial to get mocap data into ROS on your ODROID, by running vrpn_client_ros node
  2. You will need to run MAVROS node in order to connect ODROID to the flight controller.
    roslaunch mavros px4.launch fcu_url:=/dev/ttyUSB0:921600 gcs_url:=udp://@192.168.1.102:14550
    
    ttyUSB0 should match the serial port ID in your ODROID. gcs_url:=udp://@192.168.1.102:14550 this is used to allow you to receive data to QGroundControl on your machine (that has to be connected to the same WiFi router). Adjust the IP to match your PC IP, that runs QGC.
  3. relay the mocap data to the flight controller

    • If you are using LPE

      rosrun topic_tools relay /vrpn_client_node/<rigid_body_name>/pose /mavros/mocap/pose
      

      Check in QGC that you get mocap init .... message which means mocap data is received by Pixhawk.

    • if you use EKF2

      rosrun topic_tools relay /vrpn_client_node/<rigid_body_name>/pose /mavros/vision_pose/pose
      

Now you are ready to use position hold/offboard modes.

It is very important that you align the forward direction of your drone (robot) with the x-axis of your mocap when you first define a rigid body. You can find the x-axis direction in the mocap software, Motive.
If you use the Ubuntu minimal image that is provided above, you will need to adjust the WiFi connection in order to connect to your WiFi router
  • connect 5Ghz WiFi module to ODROID XU4. Open a terminal in ODROID and type
    ifconfig
    
    in order to know your WiFi module ID number. It should be something like wlan0.
  • edit the interfaces file to provide the correct WiFi module ID you got above, and use your WiFi network name and password
    nano /etc/network/interfaces
    
    After you finish editing, use CTRL+x to try to exut. It will ask you if you want to save. Hit Y key and then ENTER.

If it gives you error like permission denied use,

sudo nano /etc/network/interfaces

DONE!

results matching ""

    No results matching ""