M & Ms (not the candy but Motion and Modeling)

Engaging the push primitive and modeling the push primitive in real time.

Posted by Nelson Raphael February 4th, 2018

Pulling all the strings together.

This week has been primarily focused on writing the script for the push primitive. I am fully threading it so that the modeling will be as close to the real time motion as possible.

Thankfully some of the other motion primitives have been successfully threaded already, such as the climb primitive and I can use that as an example. Also for anything I can't seem to figure out I will usually default to Michelle for assistance.

Scripting

When breaking down the script we have quite a few methods that are in play. You have motionTiming, mainThread_vision, initialize_vision, initialize_motion, and thread motion. All of these methods play an important part, but there are a few where we will have to take note. The way the push primitive works is in a series of stages. Previously the push primitive state machine would cycle between checking the angles of the various motors, actuating the motors that needed to be adjusted, droping the torque on the ones that were actuated, and lastly circling back to the check stage to see if they had all been corrected so it can end the program.

I will be primarily dealing with the threadMotion method and insert each of the strategies here. Within the push primitive exists the strategies of inch, straighten, and gather. The default strategy is to straighten, however, this does not always work so the inch and gather will be secondary attempts to get it over the obstacle.

This method will be dictated by the start and stop conditions contained in the method of mainThread_vision. Using the stages mentioned in the earlier paragraph these conditions can easily be recreated. There is one simple concern, since my motor checker functions by cycling through each joint then it would pick up the configuration of the entire snake. There may be certain scenarios where the pull primitive will be more applicable to successfully traverse the obstacle. So after walking through some common scenarios (which are pictured below) I have noticed a commonality. If the motor the fourth motor the snake is in a position where the joint between it and the third motor is not at 180 degrees then a push would be effective there. This will require some trials first to see if it is an effective start case.

Of course with a start case you also need an end case and the end cases are a combination of just the first two joints being bent out of place or the entire snake being flat.

What's next after this step?

When this is properly threaded with the motion then it will be able to fit into the coordinator and bring us one step closer to being able to execute a single run.

Placeholder text by Nelson R.. Photographs by NASA on The Commons.