Is this the same as unchecking the "Disable Hover Mode" in the Input tab?
Nope, this is just a hack for the moment. Usually my "hover button" served two funcitons: half press = deadman, so you need to keep it half pressed while flying. if you drop the controller or want to cut power, you just let go. And pressing it all the way activated hover mode. For the kinect functionality, I want the button pressed all the way to active "kinect control mode" instead of hover mode. The checkbox just disables hover messages being sent to the flie to avoid conflicts (some better logic would be appropriate here).
So, the "Automatic Mode" button plays the role here. Is it published by /joy_node to the topic /joy in the file joy_driver_pid.py?
Yes, it is published by /joy_node on topic /joy to joy_driver_pid.py. I use the playstation controller, which maps the axes differently if you use USB or Bluetooth. In the code you can see how I use each axis. To check the deadman, I see if Button.L1 is pressed (defined at the top of the file, think it L1 is axis/button 10 in bluetooth mode and 14 in usb mode). To check if the automatic mode button is pressed enough, I see if the value of Axis.L1 < -0.75 (line 450). Buttons are pressure sensitive and 0=not pressed, -1 = fully pressed, so -0.75 = three quarters pressed. So if you wanted to trick the node into thinking into sending thrust commands the PID controller calculates, you will need all the right TF frames to be available and set Button.L1 to true and Axis.L1 to - 1.0. Also make sure that hover mode is disabled in the GUI.
Ahh, sorry. Just checked - the checkbox is redundant. If the PID controlled is active and can find the TF frames, it disabled the hover flag before it reaches the GUI. It might still be advisable to check the box, incase you rather have the behaviour default to no hover mode in case the PID controller fails (ie cannot find the transforms it needs).
omwdunkley wrote:"/cf_xyz" is only the flie position (not rotation) as estimated by the tracker. The tracker cannot estimate the rotation. The rotation estimate comes from the flie itself (so you must be connected to it and receiving roll, pitch and yaw). The GUI program sends out a /cf_xyz->/cf0 transform with just the rotation. The static transform publisher in the guide then links /cf0->/cf_gt (ground truth), which is compared against /goal in the PID controller.
For the yaw angle, I connected to the flie and the HUD moved as I rotate my flie. The only frames I can see in rviz is the camera frames, the world frame, and cf_xyz frame. /cf0 and /cf_gt did not appear.[/quote]
First, good that it can see the yaw in the hud. When you see see in rviz, what do you mean? Could you post a screenshot of rviz with all the nodes of the TF tree expanded (rviz, in the display panel, under tf, -> Tree?). This will show all the frames, even if they have no parents. /cf0 (or /cf) should automatically be sent out by the GUI if you are logging the parameters Roll Pitch Yaw. Ideally at 100hz. /cf_gt will not appear unless /cf_xyz and /cf(0) exist. Lets focus on getting /cf0 working, then we can look at the rest.
By the way, the tf graph you show me dont help so much
Useful would be the pdf generated by the command
while everything is running. It listens for 5 seconds and graphically displays the tree.