go to dummy(?) vrep+matlab

Typically: "How do I... ", "How can I... " questions
Post Reply
karabill
Posts: 6
Joined: 14 Jun 2017, 11:20

go to dummy(?) vrep+matlab

Post by karabill » 11 Jul 2017, 19:10

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

coppelia
Site Admin
Posts: 6185
Joined: 14 Dec 2012, 00:25

Re: go to dummy(?) vrep+matlab

Post by coppelia » 13 Jul 2017, 12:48

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

karabill
Posts: 6
Joined: 14 Jun 2017, 11:20

Re: go to dummy(?) vrep+matlab

Post by karabill » 17 Jul 2017, 09:26

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

coppelia
Site Admin
Posts: 6185
Joined: 14 Dec 2012, 00:25

Re: go to dummy(?) vrep+matlab

Post by coppelia » 17 Jul 2017, 20:14

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

karabill
Posts: 6
Joined: 14 Jun 2017, 11:20

Re: go to dummy(?) vrep+matlab

Post by karabill » 25 Jul 2017, 12:08

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.

Deesero
Posts: 1
Joined: 05 Oct 2017, 16:10

Re: go to dummy(?) vrep+matlab

Post by Deesero » 12 Oct 2017, 14:10

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?

coppelia
Site Admin
Posts: 6185
Joined: 14 Dec 2012, 00:25

Re: go to dummy(?) vrep+matlab

Post by coppelia » 13 Oct 2017, 08:23

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

Post Reply