Painting the robot's trace

Typically: "How do I... ", "How can I... " questions
Post Reply
CroCr
Posts: 75
Joined: 29 Dec 2022, 01:47

Painting the robot's trace

Post by CroCr »

I'm using ZeroMQ, C++ and CoppeliaSim 4.5.1 in Linux. I would like to draw the robot's path (i.e. the base's position and the end-effector's position of the arm). I need to send the actual data from my client since it has the controller. I'm looking for the most efficient way to do it. I just need some points to be drawn on the scene (i.e. not fancy painting). How can I do so? I'm running the simulation in the stepping mode.

fferri
Posts: 1230
Joined: 09 Sep 2013, 19:28

Re: Painting the robot's trace

Post by fferri »

With drawing objects.

E.g.:

Code: Select all

dwo = sim.addDrawingObject(sim.drawing_linestrip, 5, 0, -1, 1000, {1,0,0})
for i = 0, 100 do
    local x = math.cos(math.pi * 2 * i / 100)
    local y = math.sin(math.pi * 4 * i / 100)
    local z = 0.005
    sim.addDrawingObjectItem(dwo, {x, y, z})
end

Post Reply