AutoModality / vis_pose_test

Test vision pose
3 stars 1 forks source link

`/mavros/setpoint_attitude/pt_attitude` in MAVROS and Pixhawk Firmware? #3

Open weiweikong opened 9 years ago

weiweikong commented 9 years ago

Hi, after checking http://wiki.ros.org/mavros and https://github.com/mavlink/mavros/blob/master/mavros/README.md, I did not find any hint about the topic of pt_attitude. According to the

void Controller::sendAttitudeCommand()
{
    /*
     * Don't send setpoint unless offboard enabled.
     */
    if (!off_board_enabled_)
    {
        return;
    }
    mavros_msgs::PoseThrottle pt;
    pt.pose = vehicle_command_ENU_.getPose();
    pt.throttle.data = vehicle_command_ENU_.attitude.throttle;
    pt_attitude_setpoint_pub_.publish(pt);

    last_update_time_ = ros::Time::now();

    return;
}

the data structure published to pt_attitude might not be standard msgs. Also, I checked https://github.com/mavlink/mavros/tree/0.14.2/mavros_msgs/msg, which might be the 0.14.2 version which mentioned in the introudction part. But I could not find any definition about that? In addition, this topic should be received from PX4, so the Firmware also need modify to match this new control command ?

Would it be possible to share more information about this?

edkoch commented 9 years ago

Yes as stated in the README file we added a new topic to mavros. Until it makes its way into a future release of mavros you can use the version of mavros on the Automodality repository. I don’t have the code in front of me to give you the exact structure, but as you can see in the code snippet below it simply has the same pose and throttle data elements that already exist for updating the pose and throttle in mavros except that they are combined into a single topic instead of being in two separate topics.

We added the new topic to allow the updating of both the throttle and the attitude at the same time without having to update two separate topics. Besides the fact that this is more convenient, previous versions of mavros and PX4 had a bug wherein when you updated the attitude the throttle would get set to 0 which caused strange behavior in the PX4 flight stack when doing attitude control. Although I haven’t tested it, this bug may have been fixed with more recent releases of PX4 which means that if you want you can just change the vis_pose_test code and send the throttle and attitude on separate topics using the standard mavros topics. If you do that then you can use whatever version of mavros and mavlink you want as long as it is compatible with the PX4 flight stack.

-ed

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

Hi, after checking http://wiki.ros.org/mavros http://wiki.ros.org/mavros and https://github.com/mavlink/mavros/blob/master/mavros/README.md https://github.com/mavlink/mavros/blob/master/mavros/README.md, I did not find any hint about the topic of pt_attitude. According to the

void Controller::sendAttitudeCommand() { / * Don't send setpoint unless offboard enabled. / if (!off_boardenabled) { return; } mavros_msgs::PoseThrottle pt; pt.pose = vehicle_commandENU.getPose(); pt.throttle.data = vehicle_commandENU.attitude.throttle; pt_attitude_setpointpub.publish(pt);

last_update_time_ = ros::Time::now();

return;

} the data structure published to pt_attitude might not be standard msgs. Also, I checked https://github.com/mavlink/mavros/tree/0.14.2/mavros_msgs/msg https://github.com/mavlink/mavros/tree/0.14.2/mavros_msgs/msg, which might be the 0.14.2 version which mentioned in the introudction part. But I could not find any definition about that?

Would it be possible to share more information about this?

— Reply to this email directly or view it on GitHub https://github.com/AutoModality/vis_pose_test/issues/3.

weiweikong commented 9 years ago

Hi @edkoch , thank you for your helpful replies. I just checked the mavros repository and understood the mechanism of the new topics and parameters. I also know this bug when I tested OFFBOARD control with my quadrotor, so your method is a quick way to fix it. :)

Another question is that how could you efficiently debug and test your algorithms and which is the best way? Have you tested your code with POSIX SITL with MAVROS and Gazebo, or directly running the code in real flight and analysis the log from the SD card.

edkoch commented 9 years ago

In the README I suggest a series of steps to take to test and make sure everything is working properly. I have not brought up SITL yet, but intend to do so soon.

-ed Koch

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

Hi @edkoch , thank you for your helpful replies. I just checked the mavros repository and understood the mechanism of the new topics and parameters. I also know this bug when I tested OFFBOARD control with my quadrotor, so your method is a quick way to fix it. :)

Another question is that how could you efficiently debug and test your algorithms and which is the best way? Have you tested your code with POSIX SITL with MAVROS and Gazebo, or directly running the code in real flight and analysis the log from the SD card.

— Reply to this email directly or view it on GitHub.