Pick and place, robot, centerOfMassVisualizer tool

Typically: "How do I... ", "How can I... " questions
Post Reply
pogosyan.d
Posts: 1
Joined: 03 Dec 2022, 18:59

Pick and place, robot, centerOfMassVisualizer tool

Post by pogosyan.d »

Hi, I need help creating a scene similar to the one in the video "pick and
place tutorial"
https://www.youtube.com/watch?v=9X8QVcu ... =9&t=1498s

In my version, cubes of different weights (1,2,3 kg) are created and sorted
accordingly by the robot to the pails of green, blue and red colors.

The scene should include:
1) The randomly formation of cubes with different weights (1,2,3 kg) on the
conveyor that takes them to the sensor stopping conveyor.
2) The cube falls on a platform with scales(centerOfMassVisualizer tool is
used), which will show their mass.
3) The robot picks up the cube and takes it to the appropriate pail.
4) The conveyor brings the next cube.

I created a scene in which step 1 is executed:

https://drive.google.com/drive/u/0/fold ... kEp-RsveT1

but then I can't execute the scene
- I do not know how to make the scales show the mass of the cube, and not
the platform (that is, so that the cube becomes a child of the scales)
-Many scripts from the video reference do not work because there is an
older version

Please help me perform this scene

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

Re: Pick and place, robot, centerOfMassVisualizer tool

Post by coppelia »

Hello,

it seems you are using the scene developed by a third party, and we are not familiar with what they developed. But in general, about your questions:
  • use sim.createPrimitiveShape to create cubes.
  • use sim.setShapeMass to change its mass
  • to access objects, use sim.getObject instead of sim.getObjectHandle (deprecated)
  • To create a weight scale, use something like: staticMass --> forceSensor --> dynamicMass, and have the cube rest on the dynamicMass. Then use sim.readForceSensor to get the force acting on the force sensor. You'll have to subtract the mass of the dynamicMass however
  • We recommend to use a conveyor from the model library, which is up-to-date with the CoppeliaSim version (currently V4.4)
  • To find out about the pick and place configurations, use the kinematics module. In particular, simIK.findConfig.
  • To visualize the mass measured by the force sensor, you can just print to the status bar, or of course, you can display a custom user interface. A simple example of something similar can be seen in the model in <Model library>/components/sensors/laser pointer.ttm (keep the model selected for a custom UI to display during simulation)
Cheers

Post Reply