Home › Forum › SoftRobots › Getting Started › A few doubts related to Robotics application of SOFA
Tagged: GCC, Linux_ubuntu, SOFA_1912
- This topic has 6 replies, 3 voices, and was last updated 3 years, 6 months ago by Hugo.
-
AuthorPosts
-
2 March 2021 at 18:44 #18786AryaBlocked
I am new to SOFA and I have been trying to explore the environment with the tutorials provided, I actually had a few doubts which are obstructing me from using SOFA for a few soft robotics projects,
1. How do I extract real-time data from the simulator like trajectories of specific points on the robot? How can I select these specific points and how can I export their data to any external framework?
2. How do I change step-size of actuators if a pre-made actuator is used in a tutorial for eg. s90 servo in the tripod tutorial..
3. Currently I have the pre-compiled binary version of SOFA which is available on the DEFROST page, whenever I make any change in the python file of the root node and save and animate again, that change doesn’t execute in the simulator, how do I fix this?2 March 2021 at 19:03 #18787HugoKeymasterDear @aryakarani,
Thank you for your interest in SOFA and for your question.
1. In SOFA, each component in the scene graph corresponds to a C++ class. Each component has parameters which can be accessed by the user (in the GUI, or using Python script for instance): these are called the Data. Position of a MechanicalObject, time in the simulation and many information can thus be accessed during the simulation.
If you want to export these Data into a specific format you can use our Exporters: MeshExporter or VTKExporter.2. I am no expert of the SoftRobot/STLIB plugins. Which scene are you currently running in the SoftRobot plugin?
@olivier-goury do you see how change the step-size of the prefab like the s90 servo ?3. This means your change might include an error/typo or similar. It is impossible to tell without the change that you did and the full error message.
Best,
Hugo
3 March 2021 at 07:31 #18797AryaBlockedDear @hugo,
1. Thanks for that info, I do see a lot of data available in the the MechanicalDofs folder of the GUI after a simulation, I am actually interested in exporting this data from the simulation, can you please point me to a code/example that shows how that is done, also regarding the data that is available. I also wanted to know what exact points in the Mechanical object this vector3 for eg free_position data represents and is there a way to select multiple points on the mechanical model for which I can get this data?
3. Actually I am talking incase of tutorials, like if I change colour or gravity in the root node file Defaultvisualmanagerloop, it doesn’t reflect in the simulation only changes through GUI actually execute in the simulation, it doesn’t show any error message just runs the animation as per what the original conditions were.
3 March 2021 at 07:40 #18798AryaBlockedRedarding point 2,
Changing the step-size of the actuator, I found doing that is possible by just changing the value of self.stepsize in the controller file of any SoftRobot tutorial. So just posting this incase anyone else has the same doubt.
3 March 2021 at 12:14 #18804olivierBlockedHello @aryakarani,
For your point 1, have a look at the folder sofa/src/examples/Components/misc/
You should see some example of data beeing exported for examples using the componentWriteState
for position or velocity.
If you want to know which index corresponds to what on a mechanicalObject, got to the visualisation tab when you open the mechanicalObject window, and check the boxes showIndices.For your point 3, I am not sure I understand, but if you want to change the color of an object, don’t do it on the node but on the component itself.
Good luck!
Olivier4 March 2021 at 14:27 #18817AryaBlockedThank you @olivier-goury for that concise answer. I will surely try this out and let you know. Although I currently have the Binary version of Sofa, So I guess getting the source code version is essential in order to get these components and examples.
31 March 2021 at 09:16 #19027HugoKeymasterHi @aryakarani,
In fact, every points mentioned by Olivier are components available in the pre-compiled (binary) version of SOFA. You should be able to do the same.
Best wishes,
Hugo
-
AuthorPosts
- You must be logged in to reply to this topic.