当前位置: 首页>>代码示例>>C++>>正文


C++ PID::reset方法代码示例

本文整理汇总了C++中PID::reset方法的典型用法代码示例。如果您正苦于以下问题:C++ PID::reset方法的具体用法?C++ PID::reset怎么用?C++ PID::reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PID的用法示例。


在下文中一共展示了PID::reset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: nav_callback


//.........这里部分代码省略.........
    if (control_mode) {

//        cout << "TIMESTAMP " << timestamp << endl;
//        cout << "CONTADOR " << contador << endl;
//        cout << "LIMIT " << CONTROL_LIMIT << endl;
        if (timestamp < contador + CONTROL_LIMIT) {

            double u_x = pid_x.getCommand(pos_obj(0) - x(0), timestamp);
            double u_y = pid_y.getCommand(pos_obj(1) - x(1), timestamp);
            double u_z = pid_z.getCommand(pos_obj(2) - x(2), timestamp);
            double u_yaw = pid_yaw.getCommand(yaw_obj - theta(2), timestamp);



            double cx   = within(cos(theta(2)) * u_x + sin(theta(2)) * u_y, -1, 1);
            double cy   = within(-sin(theta(2)) * u_x + cos(theta(2)) * u_y, -1, 1);
            double cz   = within(u_z, -1, 1);
            double cyaw = within(u_yaw, -1, 1);

           // f_vector_print("objetivo", pos_obj);

           // f_vector_print("posicao", x);

	   cout << "SENDING AUTOMATIC CONTROLS" << endl;

            Command cmd(cx, cy, cz, cyaw);
            send_velocity_command(cmd);

        } else {

            control_mode = 0;
	    cout << "CONTROL MODE OFF" << endl;
            send_collision_mode_msg(false);
            pid_x.reset();
            pid_y.reset();
            pid_z.reset();
            pid_yaw.reset();
        }


    } else {

        OcTreeKey bbxMinKey, bbxMaxKey;

        //Vector3d lim1 = x + R * Vector3d(0, -DELTA_VOL/2, -1.0);
        //Vector3d lim2 = x + R * Vector3d(DELTA_VOL, DELTA_VOL/2, 1.0);

        point3d min_vol = point3d(x(0)-DELTA_VOL/2, x(1) -DELTA_VOL/2, x(2)-1.0);
        point3d max_vol = point3d(x(0)+DELTA_VOL/2, x(1) +DELTA_VOL/2, x(2)+1.0);


        tree.coordToKeyChecked(min_vol, bbxMinKey);
        tree.coordToKeyChecked(max_vol, bbxMaxKey);

        for(OcTree::leaf_bbx_iterator it = tree.begin_leafs_bbx(bbxMinKey, bbxMaxKey), end_bbx = tree.end_leafs_bbx(); it!= end_bbx; ++it){

            //cout << "passei" << endl;

            point3d coords = it.getCoordinate();

            Vector3d wrapped_coords = Vector3d(coords(0), coords(1), coords(2));


            //if (!in_perimeter(x, wrapped_coords, 0.5)) {
            if (!production_mode) {
                geometry_msgs::Point cell;
开发者ID:bsgiovanini,项目名称:projeto,代码行数:67,代码来源:takeoff.cpp

示例2: stop_turn

void MotorControl::stop_turn() {
    pid_interval_ticker.detach();
    pid->reset();
}
开发者ID:Ko-Robo,项目名称:Ko-Robo2015,代码行数:4,代码来源:motor-control.hpp


注:本文中的PID::reset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。