Skip to content

Commit

Permalink
[MultiverseAction] merged with multiverse_controller to update the la…
Browse files Browse the repository at this point in the history
…test changes.
  • Loading branch information
AbdelrhmanBassiouny committed Aug 16, 2024
1 parent 4aeb11e commit 284a1b8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/pycram/config/multiverse_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
"""

# Multiverse Simulation Configuration
simulation_time_step: float = 1e-2
simulation_frequency: int = int(1 / simulation_time_step)
simulation_time_step: datetime.timedelta = datetime.timedelta(milliseconds=10)
simulation_frequency: int = int(1 / simulation_time_step.total_seconds())

use_bullet_mode: bool = True
"""
If True, the simulation will always be in paused state unless the simulate() function is called, this behaves
similar to bullet_world which uses the bullet physics engine.
"""

use_controller: bool = True
use_controller: bool = False
"""
Only used when use_bullet_mode is False. This turns on the controller for the robot joints.
"""
Expand Down
2 changes: 1 addition & 1 deletion src/pycram/worlds/multiverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class Multiverse(World):
similar to bullet_world which uses the bullet physics engine.
"""

use_controller: bool = conf.use_controller and not use_bullet_mode
use_controller: bool = conf.use_controller and not conf.use_bullet_mode
"""
Whether to use the controller for the robot joints or not.
"""
Expand Down
6 changes: 4 additions & 2 deletions test/test_multiverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,9 @@ def test_get_object_contact_points(self):
self.assertIsInstance(contact_points[0], ContactPoint)
self.assertTrue(contact_points[0].link_b.object, self.multiverse.floor)
cup = self.spawn_cup([1, 1, 0.1])
self.multiverse.simulate(0.2)
# This is needed because the cup is spawned in the air so it needs to fall
# to get in contact with the milk
self.multiverse.simulate(0.3)
contact_points = self.multiverse.get_object_contact_points(cup)
self.assertIsInstance(contact_points, ContactPointsList)
self.assertEqual(len(contact_points), 1)
Expand All @@ -307,7 +309,7 @@ def test_get_contact_points_between_two_objects(self):
cup = self.spawn_cup([1, 1, 0.1])
# This is needed because the cup is spawned in the air so it needs to fall
# to get in contact with the milk
self.multiverse.simulate(0.2)
self.multiverse.simulate(0.3)
contact_points = self.multiverse.get_contact_points_between_two_objects(milk, cup)
self.assertIsInstance(contact_points, ContactPointsList)
self.assertEqual(len(contact_points), 1)
Expand Down

0 comments on commit 284a1b8

Please sign in to comment.