AutoModality / vis_pose_test

Test vision pose
3 stars 1 forks source link

Format for sending the position estimate from the vision systems?? #2

Open ajithmaniac opened 9 years ago

ajithmaniac commented 9 years ago

Hello, First of all thank you for such a nice repository which explains everything that a newbie needs to know. I have doubts regarding incorporating the xyz values from the vision system to the local coordinate system of the pixhawk.

I'm actually using a different indoor localisation system which gives the xyz of the UAV. I don't know how to incorporate them into the pixhawk's inav application. I felt faking it as the vision estimates would be the best way so can you help me with it?? I want to know what data you sent to the pixhawk wrt local coordinates and also the frequency of it??

weiweikong commented 9 years ago
local_pos_pub_ = ros_node_->advertise<geometry_msgs::PoseStamped>("/mavros/vision_pose/pose", 1000);

which define the proposed topic /mavros/vision_pose/pose, suported by MAVROS.

- INAV_W_ACC_BIAS 0.01
- INAV_W_XY_GPS_P 0
- INAV_W_XY_GPS_V 0
- INAV_W_XY_VIS_P 1
- INAV_W_Z_BARO 0.01
- INAV_W_Z_GPS_P 0
- INAV_W_Z_VIS_P 1
- INAV_W_Z_VIS_V 0 (new parameter)

But INAV_W_Z_VIS_V is not the traditional one for PX4 (also, the parameter ATT_VIS_EN, which was introduced to switch the estimator mode (INAV module ?)), so I am also confused with that. Should we modified some codes in PX4 firmware ?

edkoch commented 9 years ago

The frame of reference used by ROS is "ENU" although that term can be a bit confusing. The frame of reference used by PX4 is "NED". Mavros automatically converts between them. Please consult this isssue for a full discussion on how the frames of reference are translated:

https://github.com/mavlink/mavros/issues/216

In our testing we updated the vision pose at about 10 Hz.

edkoch commented 9 years ago

With respect to the code statement:

local_pospub = rosnode->advertise("/mavros/vision_pose/pose", 1000);

The parameter with the value of "1000" refers to the size of the message buffer, not the frequency. In our testing we were updating this topic at a frequency of about 10 Hz.

edkoch commented 9 years ago

Yes we added some new parameters to the PX4 flight stack to aid in tuning and debugging. You don't need to make these changes yourself. If you follow the directions in the README file you can down load the prebuilt version of the PX4 flight stack that is in the Automodaility repository. Hopefully these parameters will eventually make their way into an upcoming stable release of the official PX4 flight stack, but in the mean time you can use the version on this repository which is an extension of the 1.0.1 stable release version of PX4. Be sure to load the PX4 flight stack using QGroundControl or the new parameters will not appear in the parameter views of QGroundControl.

ajithmaniac commented 9 years ago

Hey @edkoch . Thanks for the replies, it was really helpful.

I'm a newbie to ros so here's my question. I have a localisation system which can give the xyz of the UAV with respect to a coordinate space of my indoor environment. I want to override the xyz data published to the /vision_pose/pose topic(by the optitrack system) with xyz data derived from my indoor localisation system.

I can send the data at 10Hz.

Is this actually possible ?? If so can you briefly guide me with it.??

edkoch commented 9 years ago

Yes it is possible, but you probably can’t use vis_pose_test in it current form to do it. The good new is that what you want to do is probably easier than what vis_pose_test is trying to do. As long as you send the coordinates to the vision_pose/pose topic in the right frame of reference it should work just fine.

I don’t know the exact specifications of the optitrack system, but I assume that it is giving you coordinates in some fixed inertial frame. All you have to do is convert that frame into the “ENU” frame that mavros assumes you are sending to the vision_pose/pose topic. Since the optitrack and the the ENU frame of reference are probably both fixed inertial frames then it is probably not very difficult to translate between them and there are probably already ROS packages that take optitrack output and translate it into ENU. I’ve seen other email threads of people using optitrack so you might want to search the PX4 users group. Rather than try to explain the ENU frame of reference and its relation to the PX4 NED frame of reference I suggest you read the following thread in which the topic is discussed in great detail:

https://github.com/mavlink/mavros/issues/216 https://github.com/mavlink/mavros/issues/216

-ed

On Oct 2, 2015, at 2:22 AM, Weiwei notifications@github.com wrote:

According to the codes in locator.cpp, the local position send to PX4 using local_pospub = rosnode->advertise("/mavros/vision_pose/pose", 1000); which define the proposed topic /mavros/vision_pose/pose, suported by MAVROS, and the frequency should be 1000Hz.

For the inav part, in the introudction part, some parameters should be changed,

  • INAV_W_ACC_BIAS 0.01
  • INAV_W_XY_GPS_P 0
  • INAV_W_XY_GPS_V 0
  • INAV_W_XY_VIS_P 1
  • INAV_W_Z_BARO 0.01
  • INAV_W_Z_GPS_P 0
  • INAV_W_Z_VIS_P 1
  • INAV_W_Z_VIS_V 0 (new parameter) But INAV_W_Z_VIS_V is not the traditional one for PX4, so I am also confused with that. Should we modified some codes in PX4 firmware ?

— Reply to this email directly or view it on GitHub https://github.com/AutoModality/vis_pose_test/issues/2#issuecomment-144883184.

ajithmaniac commented 8 years ago

Hey @edkoch , Thanks for the reply !!!! It was really helpful.. I have 2 more questions

1-> Can you just post the log when you type this command 'rostopic echo mavros/vision_pose/pose' assuming that the data is being published by the optitrack system.

2-> I'm following this guide https://pixhawk.org/dev/ros/mavros_offboard to switch to offboard control and I'm trying to compile the custom C++ code to enable offboard. I have issues with it. Can you help me with that??