Pololu Robotics & Electronics
My account Comments or questions? About Pololu Contact Ordering information Distributors

Maestro SDK Sequencer and Frames


I have written an application similar to the Maestro Control Center, but I have hard coded limitations under the Channel Settings and other features that are not necessary for my product. This design is to make it easy for a novice to set and control the servos. I am having trouble understanding the Sequencer and in what order functions should be called i.e. saving, playing back, compiling etc… I can retrieve the script and frames from the registry and load them into a TextBox and ListView.

I understand creating a new Sequence

    Private Sub NewSequence(ByVal name As String)
        If usc IsNot Nothing Then
             Dim seq As New Sequencer.Sequence(name)
        end if
    End Sub

And adding a new Frame

    Private Sub AddFrame(ByVal seqIndex As Integer)
        If usc IsNot Nothing Then
            Dim targetStr As String = ""
            Dim f As New Sequencer.Frame
            Dim us As UscSettings = usc.getUscSettings
            Dim sStatus(usc.servoCount) As ServoStatus


            For i As Integer = 0 To usc.servoCount - 1
                Dim p As Integer = sStatus(i).position
                targetStr = targetStr & p & " "

            f.name = "New Frame"
            f.length_ms = 500
            f.setTargetsFromString(targetStr, usc.servoCount)


            Dim itm As New ListViewItem
            itm.Text = f.name

        End If
    End Sub

But what do I do next? I would like to be able to save the new Sequence and play it back and send it to the Maestro.

Do you have any sample code that demonstrates the features similar to the Sequence Tab in the Maestro Control Center?

Your help is appreciated.

Thanks, Randy Moore


Hello, Randy.

We do not have any example code written in VB that demonstrates the features of the Sequence tab in the Maestro Control Center. Your question “what do I do next” is very broad. Can you be more specific about the process flow of your application and narrow down your question(s) to a feature of the Sequencer that you are trying to implement (e.g. how to save a sequence, how to convert a sequence to a script, or how to load a script onto the Maestro)?

You might consider looking at the methods in Sequence.cs and Frame.cs under Maestro/Sequence of the SDK, which could give you insight on how to do some of the functions you want in your application. Some functions in particular that might be useful for you to look at are: saveSequencesInRegistry in Sequence.cs, save in ConfigurationFile.cs, and writeScript in Usc.cs. You can look at the comments for more details on what each function does.

If you try implementing a feature of the Sequencer into your code and are having trouble getting it to work, you can post your code here, and I would be happy to take a look. When posting your code, please post a description of what you attempted and the results you are seeing compared to what you expect to see.

- Amanda