diff --git a/examples/biped.py b/examples/biped.py index aae5e806..4e721743 100644 --- a/examples/biped.py +++ b/examples/biped.py @@ -2,10 +2,10 @@ from rostok.library.rule_sets.leg_rules import get_biped from rostok.graph_grammar.graph_utils import plot_graph -scenario = WalkingScenario(0.00001, 20) +scenario = WalkingScenario(0.0001, 1) graph = get_biped() plot_graph(graph) control = controll_parameters = {"initial_value": [0]*8} -scenario.run_simulation(graph, control, starting_positions=[[0,-30,60,-30], [0,30,-60,30]], vis = True, delay=True) +scenario.run_simulation(graph, control, starting_positions=[[0,30,-60,30], [0,30,-60,30]], vis = True, delay=True) diff --git a/rostok/library/rule_sets/leg_rules.py b/rostok/library/rule_sets/leg_rules.py index 43125b6f..541ed82e 100644 --- a/rostok/library/rule_sets/leg_rules.py +++ b/rostok/library/rule_sets/leg_rules.py @@ -37,10 +37,10 @@ def create_rules(tendon=False, smc=False): def_mat = DefaultChronoMaterialNSC() # blueprint for the palm body = PrimitiveBodyBlueprint( - Box(0.05, 0.02, 0.2), material=def_mat, color=[100, 100, 0]) + Box(0.055*2, 0.055*2, 0.055*2), material=def_mat, color=[178, 82, 164]) body_q = PrimitiveBodyBlueprint( - Box(0.3, 0.02, 0.2), material=def_mat, color=[100, 100, 0]) + Box(0.3, 0.02, 0.2), material=def_mat, color=[178, 82, 164]) # blueprint for the base base = PrimitiveBodyBlueprint(Box(0.02, 0.01, 0.02), material=def_mat, @@ -48,13 +48,13 @@ def create_rules(tendon=False, smc=False): density=10000) - foot = PrimitiveBodyBlueprint(Box(0.05, 0.02, 0.03), + foot = PrimitiveBodyBlueprint(Box(0.07, 0.02, 0.05), material=def_mat, - color=[255, 0, 0], + color=[140, 150, 140], density=100) # sets effective density for the links, the real links are considered to be extendable. link_mass = (28 + 1.62 + 2.77) * 1e-3 - length_link = [0.05, 0.06, 0.075] + length_link = [0.07, 0.085, 0.1] # create link blueprints using mass and length parameters link = list( map( diff --git a/rostok/simulation_chrono/simulation.py b/rostok/simulation_chrono/simulation.py index 8c6bde6f..8f83aa44 100644 --- a/rostok/simulation_chrono/simulation.py +++ b/rostok/simulation_chrono/simulation.py @@ -57,15 +57,15 @@ def initialize_vis(self, chrono_system): self.vis.Initialize() self.vis.AddSkyBox() self.vis.AddCamera(chrono.ChVectorD(-0.15, 0.35, 0.40), chrono.ChVectorD(0.0, 0.1, 0)) - self.vis.AddLight(chrono.ChVectorD(0.4, 0.0, -0.4), 0.28, chrono.ChColor(1, 1, 1)) - self.vis.AddLight(chrono.ChVectorD(0.4, 0.0, 0.4), 0.28, chrono.ChColor(1, 1, 1)) - self.vis.AddLight(chrono.ChVectorD(-0.4, 0.0, -0.4), 0.28, chrono.ChColor(1, 1, 1)) - self.vis.AddLight(chrono.ChVectorD(-0.4, 0.0, 0.4), 0.28, chrono.ChColor(1, 1, 1)) - self.vis.AddLight(chrono.ChVectorD(0.4, 0.8, -0.4), 0.28, chrono.ChColor(1, 1, 1)) - self.vis.AddLight(chrono.ChVectorD(0.4, 0.8, 0.4), 0.28, chrono.ChColor(1, 1, 1)) - self.vis.AddLight(chrono.ChVectorD(-0.4, 0.8, -0.4), 0.28, chrono.ChColor(1, 1, 1)) - self.vis.AddLight(chrono.ChVectorD(-0.4, 0.8, 0.4), 0.28, chrono.ChColor(1, 1, 1)) - + # self.vis.AddLight(chrono.ChVectorD(0.4, 0.0, -0.4), 0.28, chrono.ChColor(1, 1, 1)) + # self.vis.AddLight(chrono.ChVectorD(0.4, 0.0, 0.4), 0.28, chrono.ChColor(1, 1, 1)) + # self.vis.AddLight(chrono.ChVectorD(-0.4, 0.0, -0.4), 0.28, chrono.ChColor(1, 1, 1)) + # self.vis.AddLight(chrono.ChVectorD(-0.4, 0.0, 0.4), 0.28, chrono.ChColor(1, 1, 1)) + # self.vis.AddLight(chrono.ChVectorD(0.4, 0.8, -0.4), 0.28, chrono.ChColor(1, 1, 1)) + # self.vis.AddLight(chrono.ChVectorD(0.4, 0.8, 0.4), 0.28, chrono.ChColor(1, 1, 1)) + # self.vis.AddLight(chrono.ChVectorD(-0.4, 0.8, -0.4), 0.28, chrono.ChColor(1, 1, 1)) + # self.vis.AddLight(chrono.ChVectorD(-0.4, 0.8, 0.4), 0.28, chrono.ChColor(1, 1, 1)) + self.vis.AddTypicalLights() def enable_collision_shape(self): self.vis.EnableCollisionShapeDrawing(True) diff --git a/rostok/simulation_chrono/simulation_scenario.py b/rostok/simulation_chrono/simulation_scenario.py index 1ede36f5..4bdc2d4c 100644 --- a/rostok/simulation_chrono/simulation_scenario.py +++ b/rostok/simulation_chrono/simulation_scenario.py @@ -183,7 +183,8 @@ def run_simulation(self, def_mat = DefaultChronoMaterialNSC() floor = creator.create_environment_body(EnvironmentBodyBlueprint(Box(1, 0.1, 1), material=def_mat, color=[215, 255, 0])) floor.body.SetNameString("Floor") - floor.body.SetPos(chrono.ChVectorD(0,0,0)) + floor.body.SetPos(chrono.ChVectorD(0,-0.05,0)) + floor.body.GetVisualShape(0).SetTexture("D:\\Program\\miniconda\\envs\\rostok\\Library\\data\\textures\\bluewhite.png", 10, 10) #floor.body.SetBodyFixed(True)