
Mickey666Maus

Hey guys, I was trying to script some animation for my robot...trying to figure out how to make smooth animations which will run correctly timed and without getting jumpy servos!
I experienced that my script is running smooth if it is the only thing running, once I start the camera the movement gets really choppy/jumpy...is this because the camera takes too much bandwidth, is the communication to the board being flooded? It does not happen if I use the Laptops Webcam!
How do I workaround this?
Is my approach of scripting animation wrong? My idea was to animate 30FPS and point out the specific servo position for every frame, followed by a pause...
like this
ServoSpeed(D8,0) ServoSpeed(D6,0)
Servo(D8,39.417) Servo(D6,96.2251) Sleep(33.3333) Servo(D8,35.6368) Servo(D6,99.7181) Sleep(33.3333) Servo(D8,30.7226) Servo(D6,104.559) Sleep(33.3333) Servo(D8,25.8083) Servo(D6,109.944) Sleep(33.3333)
etc...
The camera and servo communication are on separate tcp connections - it's unlikely that the wifi is the cause. Although you can investigate further by performing a wifi scan to see if there's a free wifi channel to switch to.
I would suspect the PC/cpu is causing the jerkiness by having many tasks/threads running. Specifically if any tracking methods are enabled.
Do you have a faster computer to try your program on?
Hey, thanks for suggesting to check the tasks...its always something to keep in mind I guess, and also good to know that the camera is on a different port!
The laptop is quiet fast... Intel i7
I set my router to an unpolluted Wifi channel
But actually the animation is being made in another application before, this application writes a textfile which I copy and paste into an EZ-Script...so there is no other application involved, only ARC!
It runs smooth, but when the camera is turned on it gets choppy/jumpy...I will check the tasks once more because there might be one thing on the PC side polluting the Wifi connectifity, I will keep you updated!
Thanks for helping to push this into the right direction!
:) anytime!
tasks sometimes are limited due to the application as well. This is something that can be controlled by the application - Windows manages priorities of tasks.
The accuracy of the sleep() command uses a thread sleep, which isn't real time due to windows not being a realtime OS. So there is a high probability that the thread.sleep running in the background might not be 33.3 ms but 50ms or even 100ms if the thread manager is being fussy.
What program are you using to create the animations? I wonder if a plugin would suit your needs to parse the data before rather than running as a script. I might be able to help you with that
This is actually something that I did not think of....so it could be the priority of tasks which messes with my animation timing hmmmm....
I have build a little Lego Robot to test out animation, I also build and rigged this robot in 3ds max...it is connected directly to the real world model with ARCs HTTP Server ( you helped me to connect 3ds max using max script some time ago).
So I can build an animation inside of 3ds max (which is free for three years if you want to study and personally use it by the way...), and playback the animation on my real world model to check for unwanted collisions or weird stuff that could cause damage to the servos!
Also while doing the playback 3ds max writes all the animation into a .txt file that I can copy and past into my EZ-Script to use the animation directly within ARC...
If the data can be pre-processed or parsed in any other way, I would be really interested in how this can be done!
I made a short clip on how far I got till now, next steps will be making a better model and working more on animation and timing!
@Mickey666Maus I was thinking about adding to this topic but I want to make sure I understand what is happening first.
It appears you have created an image of a robot in 3DS Max which you have "rigged" such that you can move various parts of it (probably with the mouse). Each movable part corresponds to a movable part of the actual robot and a servo which drives that part. When you move the part in 3DS, something is sent to ARC via the HTTP Server which causes the actual robot to move in the same way. In addition, 3DS generates a text file which is a record of the moves. The text file can be placed into a script by a copy and paste operation, allowing the robot to play back the movements.
Is this correct?
@WBS00001 That is correct, with this method I would like to create animations for my robot which can be played back in ARC, 3ds max offers a wide range of animation controls which is the reason I would like to use it for that specific purpose!
Also the next step will be to build the robot directly in 3ds max and use a printer to create the real world robot, contrary to what I was doing this time...which was building the robot first and making the digital counterpart second!