Example #1
0
    def run_contact_generation(self):
        print("### MLP : contact sequence ###")
        generate_contact_sequence, ContactGenerationOutputs = self.cfg.get_contact_generation_method()
        self.cs, self.fullBody, self.viewer = generate_contact_sequence(self.cfg)
        ContactGenerationOutputs.assertRequirements(self.cs)
        self.gui = self.viewer.client.gui

        if self.cfg.WRITE_STATUS:
            with open(self.cfg.STATUS_FILENAME, "a") as f:
                f = open(self.cfg.STATUS_FILENAME, "a")
                f.write("gen_cs_success: True\n")

        if self.cfg.DISPLAY_CS_STONES:
            display_tools.displaySteppingStones(self.cs, self.gui, self.viewer.sceneName, self.cfg.Robot)
        if self.cfg.DISPLAY_CS:
            if display_tools.DisplayContactSequenceRequirements.checkAndFillRequirements(self.cs, self.cfg, self.fullBody):
                input("Press Enter to display the contact sequence ...")
                display_tools.displayContactSequence(self.viewer, self.cs)
def dispCS(step=0.2):
    display_tools.displayContactSequence(viewer, cs, step)
Example #3
0
 def display_cs(self, step=0.2):
     display_tools.displayContactSequence(self.viewer, self.cs, step)
import mlp.config as cfg
import mlp.viewer.display_tools as display_tools

print "### MLP : contact sequence ###"
from mlp.contact_sequence import generateContactSequence
cs, fullBody, viewer = generateContactSequence()

if cfg.WRITE_STATUS:
    f = open(cfg.STATUS_FILENAME, "a")
    f.write("gen_cs_success: True\n")
    f.close()

if cfg.DISPLAY_CS:
    raw_input("Press Enter to display the contact sequence ...")
    display_tools.displayContactSequence(viewer, cs)
if cfg.SAVE_CS:
    filename = cfg.CONTACT_SEQUENCE_PATH + "/" + cfg.DEMO_NAME + ".cs"
    print "Write contact sequence binary file : ", filename
    cs.saveAsBinary(filename)
if cfg.DISPLAY_CS_STONES:
    display_tools.displaySteppingStones(cs, viewer.client.gui,
                                        viewer.sceneName, cfg.Robot)

print "------------------------------"
print "### MLP : centroidal, initial Guess ###"
from mlp.centroidal import generateCentroidalInitGuess
cs_initGuess = generateCentroidalInitGuess(cs,
                                           fullBody=fullBody,
                                           viewer=viewer)

if cfg.DISPLAY_INIT_GUESS_TRAJ and cs_initGuess: