Search found 6175 matches

by coppelia
17 Nov 2017, 15:40
Forum: General questions
Topic: Get orientation and use it for a specific task
Replies: 4
Views: 13

Re: Get orientation and use it for a specific task

In the while loop, you retrieve the orientation with:

Code: Select all

local e=simGetEulerAnglesFromMatrix(m)
but it should be:

Code: Select all

e=simGetEulerAnglesFromMatrix(m)
Otherwise you create another local variable e, that disappears when the while loop loops.

Cheers
by coppelia
17 Nov 2017, 10:09
Forum: General questions
Topic: Get orientation and use it for a specific task
Replies: 4
Views: 13

Re: Get orientation and use it for a specific task

Hello Davide, this is because the e-puck model base has a default orientation of {-pi/2,0,-pi/2} by default (i.e. x-component of the e-puck orientation frame is pointing up, the z-component of e-puck orientation frame is pointing to the forward movement direction). To overcome this you have two opti...
by coppelia
15 Nov 2017, 15:36
Forum: General questions
Topic: Extract a vector from a table
Replies: 2
Views: 20

Re: Extract a vector from a table

Sorry, I don't get your question. What dimension? What random couple?

Btw, simGetVisionSensorCharImage is faster than simGetVisionSensorImage. It however returns a string buffer instead of a table.

Cheers
by coppelia
15 Nov 2017, 09:07
Forum: General questions
Topic: Restore components to their original state
Replies: 2
Views: 33

Re: Restore components to their original state

Hello, for every e-puck, you will have to do something like: -- init phase: local initConf=simGetConfigurationTree(modelBase) -- reset: -- sim.setThreadAutomaticSwitch(false) -- in case your script is threaded local objects=simGetObjectsInTree(modelBase,sim_handle_all,0) for i=1,#objects,1 do simRes...
by coppelia
15 Nov 2017, 08:53
Forum: General questions
Topic: How to add disturbance in Joint space or Cartesian Space for Torque/Impedance Control
Replies: 1
Views: 25

Re: How to add disturbance in Joint space or Cartesian Space for Torque/Impedance Control

Hello, I am afraid we have not enough experience with impedance control algorithms. But on the question why disturbance does not have any effect, my only guess would be that the disturbance amplitude is probably not large enough (or frequency too high?). At the same time, in order to get best result...
by coppelia
15 Nov 2017, 08:45
Forum: General questions
Topic: Exchange information between ePucks
Replies: 1
Views: 18

Re: Exchange information between ePucks

Hello, you have several possibilities for that. For instance: you can use simSetScriptVariable to set a variable in another script you can use simCallScriptFunction to call a function in another script (which can then change the lua state in that scipt) you can use simWriteCustomDataBlock and simRea...
by coppelia
13 Nov 2017, 22:45
Forum: General questions
Topic: Reading and displaying video sensor images using py3 remote API
Replies: 2
Views: 29

Re: Reading and displaying video sensor images using py3 remote API

Hello Tony, here a simple example that streams and displays an image, using openCV: # -*- coding: utf-8 -*- """ Created on Sun Jul 05 15:01:58 2015 @author: ACSECKIN """ import vrep import time import cv2 import numpy as np vrep.simxFinish(-1) clientID = vrep.simxStart('127.0.0.1', 19999, True, True...
by coppelia
13 Nov 2017, 22:43
Forum: General questions
Topic: Vision sensor
Replies: 1
Views: 27

Re: Vision sensor

Hello,

correct should be like:

Code: Select all

local filenameAndPath='c:/myImage.png'
But this does not work here either. Any other path works fine. e.g.

Code: Select all

local filenameAndPath='d:/myImage.png'
works fine.

Cheers
by coppelia
13 Nov 2017, 22:26
Forum: General questions
Topic: Conversion of Depth Map to 3D point cloud using Kinect
Replies: 12
Views: 8457

Re: Conversion of Depth Map to 3D point cloud using Kinect

Can you make it display an different image from within the child script? Do you think your problem is related to the usage of the remote API? How do you apply the image to the vision sensor?

Cheers
by coppelia
13 Nov 2017, 22:20
Forum: General questions
Topic: How to change the origin of the absolute coordinate system
Replies: 1
Views: 24

Re: How to change the origin of the absolute coordinate system

Hello,

you can just subtract values from your coordinates to obtain that shift. Or you can use the third argument of simxGetObjectPosition to retrieve the position relative to another object (which could be a dummy appropriately placed in the scene).

Cheers