Closed idhamari closed 4 years ago
@yasseerr
I saw you already updated the code. How is the progress so far? did you figure out how to animate the 3D view based on the motion file?
hi! @idhamari The progress is doing some what fine after some code inspection, the data in the motion file is loaded and assigned to the model but for now only the first frame/state of the motion is displayed(to be checked if it is aligned) and i'm currently working on the animation frame by frame by updating the 3D geometries in response to a Timer.
for now only the first frame/state of the motion is displayed(to be checked if it is aligned)
Well done :watermelon: I think this is the difficult part, to understand how OpenSim treats the geometry and present them in the 3D widget, you may get crazy-looking animation based on the configuration as a small error in the transformation makes everything goes wrong. I suggest you check the example I provided as it uses only OpenSim without the java interface (you get a direct connection between the visualizer and opensim).
Please notice that the animation in the simulation is similar, the only difference is these states are generated online.
you are right i'm currently trying to adjust the crazy-looking animations and will switch to the code you posted in the open-sim forum as it looks more straight forward
I had the same thing when I worked with this before (the problem was the angles unit). Try to trace frame 0 and frame 1 and check what is wrong. Check how somebody visualizer handles the information. Probably there are transformations happen within the simbody visualizer code.
I am not sure if we need this but probably we may a need a transformation class from opensim to vtk. It should transform everything from opensim world to vtk world.
Please note:
If you like, we can arrange an online meeting this week.
thanks for the notes! and the methodes for handling changes/transforms from opensim to vtk are created in the vtkVisualizer, with radian unit. but what left is to implement the tool bar buttons and popup menu for the motion. also i'm trying to optimize the perfermance, because the motion is slow when rendering frames eventhough calculations needed are minimized. for the meeting contact me when you have time.
This looks great. Thanks for the excellent job :watermelon:
but what left is to implement the toolbar buttons and popup menu for the motion.
For now, only the motion toolbar functions are needed. You may ignore the popup menu.
also i'm trying to optimize the performance because the motion is slow when rendering frames even though calculations needed are minimized. for the meeting contact me when you have time.
I will test this in my workstation with 32GB memory and RTX2080Ti GPU and report. Please let me know if the updated code is already in your branch.
Please check if the problem from vtk, qt, the images in the widget, or size of the stl:
for the meeting contact me when you have time.
This week is already booked. What about next week on Tuesday at 11:00 or 17:00 German time?
@yasseerr
Update: I just checked the code. The performance seems to be OK and the motion looks normal. Please implement the toolbar and close this issue.
Note: I have only a problem interacting with the widget before loading the model or the motion (this problem wan not there before). When moving the mouse it acts as drag (e.g. click and move) which makes the objects rotate with the mouse movement. I suspect this is a Linux-Qt problem as I have this before with other programs so you may ignore this problem for now until I check this in my windows.
@idhamari another update, i just pushed an optimized code for motion exemple now it moves kind of smoothly even though it is not on a RTX2080Ti 🥇 i will optimise more whenever possible ,i'm switching now to the tool bar. concerning the dragging error try with the last commit although it does not appear on windows. if it is consistent i will try it on a VM. for the meeting next week on Tuesday is good.
@yasseerr well done! by the way, in my previous comment, I tested the code on my laptop not on a workstation. The performance was good. I will check your updated code soon and provide feedback if needed.
hello @idhamari the motion tools are implemented give them a check to see if something is missing . currently i'm merging the simulation with the master.
Well done :watermelon: I will close the issue for now and it can be-reopened if needed.
With the current knowledge from the motion, handling the simulation task should be much simpler. You can check the same pendulum example and see how the visualizer work during the simulation process. In the simulation process, opensim computes the states online then sends them to the visualizer to animate the model, when the simulation completed, opensim load the motion to the navigator so the user can save it to a file if needed.
@yasseerr
Two more todos here:
Model: Pipelines/Gait2354_Simbody/OutputReference/subject01_simbody.osim Motion: Pipelines/Gait2354_Simbody/OutputReference//subject01_walk1_ik.mot
Update: the make current option on the motion popup menu is implemented but the reason for why that rogue muscle appear i couldn't find it yet
@yasseerr
well done!
but the reason for why that rogue muscle appear i couldn't find it yet
it is OK for now, we will have a good idea after the implementation of simulation. Please proceed to the next task in this milestone.
thanks! just a note i found out that when i recreate the vtk actors each frame instead of just changing the coordinates ,rotaion and display properties the problem go away . It is done like that in netbeans but it causes a huge lack of performance when implemented in vtk. so that muscle is a performance optimization issue, and i will try and find how to mix the two solutions to avoid the muscle being rendered. after finishing the Simulation.
I already created a new issue to handle this. Please keep the related discussion there. I will copy your feedback to the new issue. For now please concentrate on the simulation task as it is the final task in this milestone (other tasks will be handled by the other students).
Example in
note that later, we will do the simulation in a somehow similar way.