Page 1 of 1

go to dummy(?) vrep+matlab

Posted: 11 Jul 2017, 19:10
by karabill
Hello,

Im newbie in vrep and i want your help. I want to make the pioneer_p3dx robot go to a point for an example a dummy which i want to name it "end". I am using matlab to control the robot. Should I code it from matlab or from a child script? How can i do that?

Thanks in advance,
Karabill

Re: go to dummy(?) vrep+matlab

Posted: 13 Jul 2017, 12:48
by coppelia
Hello,

the best would be to first do everything in V-REP, via child scripts. Then you can also quickly say what is going wrong.
Also, it really depends if you need path planning functionality. If yes, then I definitely recommend you to do everything from child scripts, and only have Matlab trigger the path planning or motion operations.

Cheers

Re: go to dummy(?) vrep+matlab

Posted: 17 Jul 2017, 09:26
by karabill
coppelia wrote:Hello,

the best would be to first do everything in V-REP, via child scripts. Then you can also quickly say what is going wrong.
Also, it really depends if you need path planning functionality. If yes, then I definitely recommend you to do everything from child scripts, and only have Matlab trigger the path planning or motion operations.

Cheers
Thanks for your answer. So I have to delete the previous script on pioneer_p3dx and write a new one ?? Also, when you say to trigger the robot from matlab, what do you mean ? To start moving the robot and the rest program to run via vrep?

Thanks in advance,
Karabill

Re: go to dummy(?) vrep+matlab

Posted: 17 Jul 2017, 20:14
by coppelia
Yes, you will have to replace the existing code for the Pioneer robot with your low-level control. And do only the high-level control from Matlab (e.g. send from Matlab the desired target position for the robot to reach. Then, on the V-REP side, handle the motion of the motors in order to reach that desired target position)

Cheers

Re: go to dummy(?) vrep+matlab

Posted: 25 Jul 2017, 12:08
by karabill
coppelia wrote:Yes, you will have to replace the existing code for the Pioneer robot with your low-level control. And do only the high-level control from Matlab (e.g. send from Matlab the desired target position for the robot to reach. Then, on the V-REP side, handle the motion of the motors in order to reach that desired target position)

Cheers
Hi again, I really cant find the command to set the target position. I find only this simxSetJointTargetPosition but it isn't the right one.

Re: go to dummy(?) vrep+matlab

Posted: 12 Oct 2017, 14:10
by Deesero
karabill wrote: Hi again, I really cant find the command to set the target position. I find only this simxSetJointTargetPosition but it isn't the right one.
Same here, how do you set the target position?

Re: go to dummy(?) vrep+matlab

Posted: 13 Oct 2017, 08:23
by coppelia
There is no command to set the target position of the robot. V-REP is a robotics toolbox, and you'll have to program things yourself. There is no such command as Robot, go to position X/Y, because that will depend on the type of robot, the type of algorithm , etc. The robot could have two wheels, 3 wheels, 1 sphere, 4 wheels, etc. The way to control all those robots will be different. Also, you could have your algorithm drive the robot directly to the X/Y position, or you could have the algorithm drive to the X/Y position by avoiding obstacles, or by driving backwards, etc.

So for all those variables, you have algorithms that will deal with your problem. But you will have to write that algorithm for the robot to move, and you will have to tell the algorithm what robot and movement it has to deal with.

Once your algorithm is written, it will take some input (e.g. the current robot position and the desired target position), and generate some outputs over time (i.e. the left and right wheel motor velocity to apply).

Cheers