-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of github.com:cram2/pycram into knowledge
- Loading branch information
Showing
209 changed files
with
18,506 additions
and
33,516 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,31 @@ | ||
# .readthedocs.yaml | ||
# Read the Docs configuration file | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
# Required | ||
version: 2 | ||
|
||
# Set the OS, Python version and other tools you might need | ||
build: | ||
os: "ubuntu-20.04" | ||
os: ubuntu-22.04 | ||
tools: | ||
python: "3.8" | ||
python: "3.9" | ||
apt_packages: | ||
- graphviz | ||
- python3-catkin-pkg | ||
jobs: | ||
pre_build: | ||
# Generate the Sphinx configuration for this Jupyter Book so it builds. | ||
- "jupyter-book config sphinx doc/source" | ||
|
||
python: | ||
install: | ||
- requirements: doc/requirements.txt | ||
install: | ||
- requirements: doc/requirements.txt | ||
# - method: pip | ||
# path: . | ||
# extra_requirements: | ||
# - catkin_pkg | ||
# - sphinx | ||
|
||
submodules: | ||
exclude: all | ||
sphinx: | ||
builder: html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import datetime | ||
|
||
from typing_extensions import Type | ||
|
||
from .world_conf import WorldConfig | ||
from pycram.description import ObjectDescription | ||
from pycram.helper import find_multiverse_resources_path | ||
from pycram.object_descriptors.mjcf import ObjectDescription as MJCF | ||
|
||
|
||
class MultiverseConfig(WorldConfig): | ||
# Multiverse Configuration | ||
resources_path = find_multiverse_resources_path() | ||
""" | ||
The path to the Multiverse resources directory. | ||
""" | ||
|
||
# Multiverse Socket Configuration | ||
HOST: str = "tcp://127.0.0.1" | ||
SERVER_HOST: str = HOST | ||
SERVER_PORT: str = 7000 | ||
BASE_CLIENT_PORT: int = 9000 | ||
|
||
# Multiverse Client Configuration | ||
READER_MAX_WAIT_TIME_FOR_DATA: datetime.timedelta = datetime.timedelta(milliseconds=1000) | ||
""" | ||
The maximum wait time for the data in seconds. | ||
""" | ||
|
||
# Multiverse Simulation Configuration | ||
simulation_time_step: datetime.timedelta = datetime.timedelta(milliseconds=10) | ||
simulation_frequency: int = int(1 / simulation_time_step.total_seconds()) | ||
""" | ||
The time step of the simulation in seconds and the frequency of the simulation in Hz. | ||
""" | ||
|
||
simulation_wait_time_factor: float = 1.0 | ||
""" | ||
The factor to multiply the simulation wait time with, this is used to adjust the simulation wait time to account for | ||
the time taken by the simulation to process the request, this depends on the computational power of the machine | ||
running the simulation. | ||
""" | ||
|
||
use_static_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 = False | ||
use_controller = use_controller and not use_static_mode | ||
""" | ||
Only used when use_static_mode is False. This turns on the controller for the robot joints. | ||
""" | ||
|
||
default_description_type: Type[ObjectDescription] = MJCF | ||
""" | ||
The default description type for the objects. | ||
""" | ||
|
||
use_physics_simulator_state: bool = True | ||
""" | ||
Whether to use the physics simulator state when restoring or saving the world state. | ||
""" | ||
|
||
clear_cache_at_start = False | ||
|
||
let_pycram_move_attached_objects = False | ||
let_pycram_handle_spawning = False | ||
|
||
position_tolerance = 2e-2 | ||
prismatic_joint_position_tolerance = 2e-2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
import math | ||
import os | ||
|
||
from typing_extensions import Tuple, Type | ||
from pycram.description import ObjectDescription | ||
from pycram.object_descriptors.urdf import ObjectDescription as URDF | ||
|
||
|
||
class WorldConfig: | ||
|
||
""" | ||
A class to store the configuration of the world, this can be inherited to create a new configuration class for a | ||
specific world (e.g. multiverse has MultiverseConfig which inherits from this class). | ||
""" | ||
|
||
resources_path = os.path.join(os.path.dirname(__file__), '..', '..', '..', 'resources') | ||
resources_path = os.path.abspath(resources_path) | ||
""" | ||
Global reference for the resources path, this is used to search for the description files of the robot and | ||
the objects. | ||
""" | ||
|
||
cache_dir_name: str = 'cached' | ||
""" | ||
The name of the cache directory. | ||
""" | ||
|
||
cache_dir: str = os.path.join(resources_path, cache_dir_name) | ||
""" | ||
Global reference for the cache directory, this is used to cache the description files of the robot and the objects. | ||
""" | ||
|
||
clear_cache_at_start: bool = True | ||
""" | ||
Whether to clear the cache directory at the start. | ||
""" | ||
|
||
prospection_world_prefix: str = "prospection_" | ||
""" | ||
The prefix for the prospection world name. | ||
""" | ||
|
||
simulation_frequency: int = 240 | ||
""" | ||
The simulation frequency (Hz), used for calculating the equivalent real time in the simulation. | ||
""" | ||
|
||
update_poses_from_sim_on_get: bool = True | ||
""" | ||
Whether to update the poses from the simulator when getting the object poses. | ||
""" | ||
|
||
default_description_type: Type[ObjectDescription] = URDF | ||
""" | ||
The default description type for the objects. | ||
""" | ||
|
||
use_physics_simulator_state: bool = False | ||
""" | ||
Whether to use the physics simulator state when restoring or saving the world state. | ||
Currently with PyBullet, this causes a bug where ray_test does not work correctly after restoring the state using the | ||
simulator, so it is recommended to set this to False in PyBullet. | ||
""" | ||
|
||
let_pycram_move_attached_objects: bool = True | ||
let_pycram_handle_spawning: bool = True | ||
let_pycram_handle_world_sync: bool = True | ||
""" | ||
Whether to let PyCRAM handle the movement of attached objects, the spawning of objects, | ||
and the world synchronization. | ||
""" | ||
|
||
position_tolerance: float = 1e-2 | ||
orientation_tolerance: float = 10 * math.pi / 180 | ||
prismatic_joint_position_tolerance: float = 1e-2 | ||
revolute_joint_position_tolerance: float = 5 * math.pi / 180 | ||
""" | ||
The acceptable error for the position and orientation of an object/link, and the joint positions. | ||
""" | ||
|
||
use_percentage_of_goal: bool = False | ||
acceptable_percentage_of_goal: float = 0.5 | ||
""" | ||
Whether to use a percentage of the goal as the acceptable error. | ||
""" | ||
|
||
raise_goal_validator_error: bool = False | ||
""" | ||
Whether to raise an error if the goals are not achieved. | ||
""" | ||
@classmethod | ||
def get_pose_tolerance(cls) -> Tuple[float, float]: | ||
return cls.position_tolerance, cls.orientation_tolerance |
Oops, something went wrong.