Path Planning in V-REP

Typically: "How do I... ", "How can I... " questions
Post Reply
ivandariojr
Posts: 8
Joined: 05 Jun 2014, 14:25

Path Planning in V-REP

Post by ivandariojr » 08 Jul 2014, 15:09

I am trying to implement some path planning algorithms in V-REP from a C++ plug-in. This planning module is intended for robotic arms. Specifically, I am doing sample-based motion planning. How do you query the simulator to check if a particular configuration will collide? Even if I cannot do a full collision detection between joints, is there any way to use the forward-kinematics in V-REP to detect whether a set of joint angles will lead to a collision at the end-effector?

In fact, is there any way you could perhaps elaborate on the different joint modes and the commands to use them? There seems to be quite a lot of them. In addition what does having a hybrid joint mean in terms of controlling the joint?
Last edited by ivandariojr on 09 Jul 2014, 16:24, edited 1 time in total.

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

Re: Path Planning in V-REP

Post by coppelia » 09 Jul 2014, 10:29

Hello Ivan,

have a look at following API functions:
With the first one, set all your desired joint positions, so as to have your robot in the desired configuration. With the second one, you can then test whether the configuration collides or not. I would define a collection for the robot, so that you'll have to call only one time simCheckCollision to check the whole robot.

And you could also decide to check for minimum distances, instead of collisions: simCheckDistance.

Cheers

ivandariojr
Posts: 8
Joined: 05 Jun 2014, 14:25

Re: Path Planning in V-REP

Post by ivandariojr » 09 Jul 2014, 15:21

Thanks for the swift reply.

For simSetJointPosition, will that move the actual joint while in simulation? Does that then mean that if there is a collision it may cause the robot or obstacle to move? What is the joint mode this function requires?

As for simCheckCollision would defining a collection still allow it to detect internal collisions?

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

Re: Path Planning in V-REP

Post by coppelia » 10 Jul 2014, 10:03

If you are moving your joint, checking for collision, then moving your joint back, there should be no problem doing this during simulation (i.e. there won't be objects being displaced, since the dynamics calculation pass will not be called during that time).

If you want to check robot self-collisions, then you will have to check a second type of collision:
  • simCheckCollision(robotCollection,sim_handle_all)
  • simCheckCollision(robotCollection,robotCollection)
Just make sure that the collidable shapes in your robotCollection have correct Collection self-collision indicators.

Cheers

cmayer777
Posts: 4
Joined: 02 Sep 2014, 04:01

Re: Path Planning in V-REP

Post by cmayer777 » 21 Sep 2014, 22:26

coppelia wrote:
...
If you want to check robot self-collisions, then you will have to check a second type of collision:
  • simCheckCollision(robotCollection,sim_handle_all)
  • simCheckCollision(robotCollection,robotCollection)
Just make sure that the collidable shapes in your robotCollection have correct Collection self-collision indicators.

Cheers
This functionality seems to be missing from the simx list of external API calls. Is there an alternate way to check for self collision using an external C++ app?

Thanks,

Chris

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

Re: Path Planning in V-REP

Post by coppelia » 22 Sep 2014, 22:38

Hello Chris,

if a remote API function is missing, you can simply call the equivalent function from within a non-threaded child script, and hand over to the remote API client the data (e.g. with a signal, e.g. simSetIntegerSignal). Then you can read that signal from your remote API client with simxGetIntegerSignal.

Cheers

Post Reply