Making the quadricopter follow a path

Typically: "How do I... ", "How can I... " questions
engharat
Posts: 7
Joined: 18 Feb 2013, 12:22

Making the quadricopter follow a path

Post by engharat » 18 Feb 2013, 12:28

Hi,
in order to let the quadricopter follow a path, I entered the default circular path, then I put a dummy on that path and it correctly move on the path while running simulation. Then I link the dummy with the quadricopter, but nothing happens: the dummy follow the path while the quadricopter stay still. Because of the quadricopter follows the manipulation sphere I'm supposing that the dummy should be linked to the manipulation sphere, but I cannot link them. How can I do that?

P.S. I think the v-rep manual should be improved in the "path" part, with a tutorial and with more talking about how to link robot with dummy in order to follow paths and so on.

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

Re: Making the quadricopter follow a path

Post by coppelia » 18 Feb 2013, 12:38

Hello,

If your dummy is correctly moving on the path object, then just attach the quadricopter "Quadricopter_target" to the dummy (i.e. make the "Quadricopter_target" object child of the dummy. Then, in the control script of the quadricopter, remove the command on line 10, which detaches the "Quadricopter_target" from its parent. That's it!

Cheers

anish
Posts: 21
Joined: 27 Jan 2020, 14:15

Re: Making the quadricopter follow a path

Post by anish » 03 Feb 2020, 20:18

Hai,

I need to do a similar task. But my dummy is not moving at all when I run the simulation. Here is what all I did;-
added a circular path.
added a dummy and made it child of the path.
in dummy properties, the trajectory is set to 'Follow Parent path'
Placed the dummy at the start(seen as red on the path) of the path.
Then I ran the simulation.
Is there any thing more to be done?

Also I am not able to find path planning in the calculation modules?

anish
Posts: 21
Joined: 27 Jan 2020, 14:15

Re: Making the quadricopter follow a path

Post by anish » 03 Feb 2020, 21:47

I added sim.followpath to the child script of the dummy and now it is moving with the velocity I give, I have kept it small.
But now when I add quadcopter and make its target child of the dummy. It is not following, the quad loses control and falls.
Do I have to do anything additional? (Line 10 in quad is disabled to detach the target from it).

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

Re: Making the quadricopter follow a path

Post by coppelia » 04 Feb 2020, 06:58

Hello,

why don't you leave the quadcopter target in its tree, but simply apply the same position to it as your dummy?

Cheers

anish
Posts: 21
Joined: 27 Jan 2020, 14:15

Re: Making the quadricopter follow a path

Post by anish » 04 Feb 2020, 23:57

Hai,

Thank you for your response!

I actually had done that and was facing a new problem.

For my quad_path_control algorithm; the coordinate reference frame of the dummy moving along the path and that of the QuadTarget should be the same.
Before simulation Dummy and QuadTarget appear to be in the same reference frame(with 'Z' pointing up) but as the dummy starts to move along the path its coordinate frame changes with 'Y' pointing up(All the path points have this reference frame).

Is there any way to get the path points ref frame to be the way I need(with 'Z' up)?

I tried to edit the path points by trying to rotate it with respect to its own frame and to make it identical to that of QuadTarget. But it doesn't change its orientation. Also, it doesn't seem like an ideal solution at all; since its too repetitive procedure to do it for multiple path points!

Thanks & Regards

anish
Posts: 21
Joined: 27 Jan 2020, 14:15

Re: Making the quadricopter follow a path

Post by anish » 05 Feb 2020, 00:20

Okay,
I guess I did not think this through properly! :D

So If I use 'sim.simxGetObjectPosition ' with 'relativeToObjectHandle = -1' on the dummy which is moving along the path. Then I should get its absolute position with respect to the world, right? If it is so the algorithm should work fine.

Actually for my algorithm, to work, I need at any instant (after the simulation has started) the difference in the position of the QuadTarget and the dummy(which is moving along the path) with respect to the world frame. I believe this is achievable irrespective of what the ref frame is on the dummy when it is moving on the path.

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

Re: Making the quadricopter follow a path

Post by coppelia » 05 Feb 2020, 14:57

Yes, best is not to use the automatic path following functionality. Simply programmatically adjust the position and/or the orientation of your object, according to what you need (you'll read that position/orientation from the path object). Programmatically you have so much more flexibility

Cheers

anish
Posts: 21
Joined: 27 Jan 2020, 14:15

Re: Making the quadricopter follow a path

Post by anish » 17 Feb 2020, 14:43

Hai again,

Can we control the speed of the quad target movement? Can we command to move in the x-direction with a specific velocity?

Now my quad target moves as per the path point locations. But now I want to control its speed. For example, when I code it to move to the next path control point say, 0.5m forward it moves really fast and in an uncontrolled manner. So I am thinking about using a PID controller which controls the speed input of the quad motion by taking
desired value = 0.5m
actual(current) value = 0.0m
this error will be fed as a trapezoidal velocity input(by PID) to quad such that it initially moves slow, increases speed in the middle and then gradually slows down when it approaches the desired 0.5m distance.
Can the above idea be realized in CoppeliaSim quad model?

Or is there any other way for the smooth motion of the quad?

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

Re: Making the quadricopter follow a path

Post by coppelia » 17 Feb 2020, 16:38

Hello,

instead of jumping from one path control point to the next, why not move the target along the path in steps that are simulation time-dependent? You'd use some of following API functions:
Cheers

Post Reply