Go to Goal in matlab

Typically: "How do I... ", "How can I... " questions
Post Reply
guest
Posts: 2
Joined: 25 Jan 2024, 09:55

Go to Goal in matlab

Post by guest »

Hi
What is the Matlab code to control the Pioneer mobile robot to reach the target point?
With how to use it
Please help me

fferri
Posts: 1230
Joined: 09 Sep 2013, 19:28

Re: Go to Goal in matlab

Post by fferri »

Hi,

you can move the robot by setting a target velocity for left and right wheel respectively (vLeft and vRight):

Code: Select all

    sim.setJointTargetVelocity(motorLeft, vLeft)
    sim.setJointTargetVelocity(motorRight, vRight)
and you can measure error with respect to target (assuming there is a dummy in the target pose) with:

Code: Select all

    pos = sim.getObjectPosition(targetDummyHandle, robotHandle)
    orient = sim.getObjectOrientation(targetDummyHandle, robotHandle)
(you would have x/y error -in robot's frame- in first two components of pos, and orientation error in last component of orient)

How to assign input velocities depends on the choice of your kinematic model.

Suggested reading: https://cs.gmu.edu/~kosecka/cs485/lec04-control.pdf

guest
Posts: 2
Joined: 25 Jan 2024, 09:55

Re: Go to Goal in matlab

Post by guest »

Thank you very much
But I need a complete code example of the Pioneer robot to make it completely clear
Please help me
I want a robot that tracks dummy with an algorithm potential field path planning
and It has the feature of avoiding obstacles

fferri
Posts: 1230
Joined: 09 Sep 2013, 19:28

Re: Go to Goal in matlab

Post by fferri »

You need to break down the problem into the smaller problems, e.g.:
1) deriving the robot's kinematic model
2) inverting the kinematic model
3) defining the attractive and repulsive potential fields using distance calculation module
4) moving the robot to walk the gradient of the potential field

Can't give you a complete example, as that is too time consuming, and there are no examples for any of those points, but I think it is only a matter of applying textbook formulas.

If you find any difficulty with the above tasks, you can post more specific questions.

Post Reply