Page 1 of 1
Go to Goal in matlab
Posted: 25 Jan 2024, 13:00
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
Re: Go to Goal in matlab
Posted: 25 Jan 2024, 16:12
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
Re: Go to Goal in matlab
Posted: 25 Jan 2024, 16:29
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
Re: Go to Goal in matlab
Posted: 26 Jan 2024, 23:43
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.