Robotics StackExchange | Archived questions

how do I implement a proportional drive in stageros?

my omnidirectional robot on stageros can follow a graph.. what's the easiest way to implement a proportional drive in this situation?

 while (ros :: ok())
    {

            geometry_msgs::Twist msg;


        if((grafo[0][1])&&t)
        {
            msg.linear.x = (nodos[v[t-1]].x-nodos[v[t]].x)/(grafo[0][1]);
            msg.linear.y = (nodos[v[t-1]].y-nodos[v[t]].y)/(grafo[0][1]);

            if(fabs(start.y-(nodos[v[t-1]].y))<1&&fabs(start.x-(nodos[v[t-1]].x))<1)
            {
                t--;
            }
        }

            pub.publish(msg);

            ros :: spinOnce();
            rate.sleep();
    }
}

Asked by ryuuka on 2015-10-19 20:50:49 UTC

Comments

Please reask your question with more details. There is not enough information here to reproduce or diagnose your problem. See http://wiki.ros.org/Support for guidelines on asking questions.

Asked by tfoote on 2015-10-27 17:13:35 UTC

Answers