Skip to content

Draft: v2.1.0 #364

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 115 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
b562322
Update defaults.json
hwiedPro Oct 26, 2023
ea4b644
Fix #339
hwied Oct 26, 2023
c9f5bec
Fix #331
hwied Oct 26, 2023
fb86732
Fix #338 (2)
AlpenAalAlex Dec 11, 2023
5ff300f
Fix link pose not exported in sdf #338 (1) #339
AlpenAalAlex Jan 9, 2024
ccae427
Merge branch 'master' into develop
hwiedPro Feb 13, 2024
f93c1ad
Fix install_requirements.py
hwiedPro Feb 13, 2024
1e7a797
Add frame handling
hwiedPro Feb 13, 2024
1a7a6bb
Fix to_hey_color()
hwiedPro Feb 13, 2024
a62fe45
Catch git_error when getting maintainer, author, url
hwiedPro Feb 13, 2024
078fe49
Get log level from env
hwiedPro Feb 13, 2024
53209f9
Add -m option to run pipeline for specific definition file
hwiedPro Feb 13, 2024
872eb0e
Add possibility to define default_export_config in pipeline.yml
hwiedPro Feb 13, 2024
9db3b92
Add verbose option to execute_shell_command
hwiedPro Feb 13, 2024
b3b1ed1
Make to_pretty_xml_string more robust
hwiedPro Feb 13, 2024
3a9e85f
Adapt append_string to logger usage
hwiedPro Feb 13, 2024
701fb4a
Fix setup_git script
hwiedPro Feb 13, 2024
6492934
Fix Git-LFS Readme integration
hwiedPro Feb 13, 2024
866d796
Fix several path/file handling issues
hwiedPro Feb 13, 2024
b8ea40f
Fix model_testing
hwiedPro Feb 13, 2024
fac9da6
Ensure nothing is changed on export()
hwiedPro Feb 13, 2024
0d94abd
Refactored version of Mathias commit: https://github.com/dfki-ric/pho…
hwiedPro Feb 13, 2024
a6f6e6d
Fix urdf export
AlpenAalAlex Feb 14, 2024
d5d7190
Enable Add Motor operator for batch selection
AlpenAalAlex Mar 5, 2024
5bffb2b
Apply Add Motor operator only to joints
AlpenAalAlex Mar 6, 2024
ba0a7b0
Update message boxes
AlpenAalAlex Mar 11, 2024
6fac85c
Redraws the sidebar when changing phobostype
AlpenAalAlex Mar 11, 2024
cbd6bfe
Fix tooltip
AlpenAalAlex Mar 11, 2024
a11761c
Adds search to phobos panel
AlpenAalAlex Mar 20, 2024
f6602d3
Add gearbox joints
AlpenAalAlex Apr 29, 2024
a797294
Sort parameters
AlpenAalAlex Apr 29, 2024
30be824
Merge branch 'issue324-Undefined-key-joint/type-when-exporting' into …
AlpenAalAlex Apr 29, 2024
1824884
Update editing.py
AlpenAalAlex Apr 29, 2024
02883a0
Add ball joint object
AlpenAalAlex Apr 30, 2024
da897b7
Add ball joint
AlpenAalAlex May 6, 2024
37ac79d
Set unused joint parameters to None
AlpenAalAlex May 7, 2024
8000e7c
Add universal joint
AlpenAalAlex May 7, 2024
8ae5b69
Add screw joint draft
AlpenAalAlex May 14, 2024
303579a
Add screw joint
AlpenAalAlex May 27, 2024
e265f57
Export screw joint thread pitch
AlpenAalAlex Jun 10, 2024
176b023
Remove screwdrivers before defining joints
AlpenAalAlex Jun 10, 2024
5d0cea4
Screw joint tested in gazebo
AlpenAalAlex Jun 11, 2024
ad30d4a
Add screw joint object
AlpenAalAlex Jun 11, 2024
9bd7bce
Unset unused gearbox and screw variables
AlpenAalAlex Jun 11, 2024
23f20c2
Add gearbox joint object
AlpenAalAlex Jun 12, 2024
94bdfa9
Merge remote-tracking branch 'origin/master' into develop
yarohenning Jun 13, 2024
dd48b5d
[BREAKING CHANGES] Squashed refactoring of python module
yarohenning Jun 13, 2024
bb154d9
Merge remote-tracking branch 'origin/master' into pre_v2.1.0
yarohenning Jun 13, 2024
646ceaf
Fix #363
hwiedPro Jun 14, 2024
271f34c
Bugfix for 646ceaf
hwiedPro Jun 14, 2024
e9c8921
Merge branch 'issue195-Support-for-multiple-degrees-of-freedom-joints…
AlpenAalAlex Jun 18, 2024
d194099
Add velocity2 and effort2
AlpenAalAlex Jun 25, 2024
4806387
Add spring and damping to universal joints
AlpenAalAlex Jun 26, 2024
1e4cc8e
Fix execute_shell_command for Windows
hwiedPro Jul 3, 2024
c950925
Fix faulty indentation
hwiedPro Jul 3, 2024
5928c9b
Bump version to 2.1.0
hwiedPro Jul 3, 2024
6e48d39
Implements TODO update rigid body constraints
AlpenAalAlex Jul 16, 2024
0e322b9
Remove axis from ball joint
AlpenAalAlex Jul 22, 2024
3873af0
Add universal joint object
AlpenAalAlex Jul 22, 2024
e5599be
Show orthogonal axis for universal joints
AlpenAalAlex Jul 22, 2024
f302b38
Comments and a fix
AlpenAalAlex Jul 25, 2024
7d2718a
Fix link pose not exported in sdf #338 (1) #339
AlpenAalAlex Jan 9, 2024
bce38fa
Merge branch 'Issue351-Create-Inertials-fails-if-not-all-vertices-are…
AlpenAalAlex Aug 7, 2024
989662d
Fix export fails in edit mode
AlpenAalAlex Aug 8, 2024
cde9b99
Fixes
AlpenAalAlex Aug 13, 2024
1697c1f
Fix error if child and parent are parented in opposite order
AlpenAalAlex Aug 13, 2024
624ccba
Fix #363 - 2
AlpenAalAlex Aug 22, 2024
1238689
Fix #366
AlpenAalAlex Aug 28, 2024
3309966
Add TODO: gearbox drivers
AlpenAalAlex Aug 30, 2024
ec78369
Fix tooltip
AlpenAalAlex Oct 9, 2024
a270674
Fix Add Sensor tooltip
AlpenAalAlex Nov 14, 2024
199c890
Fix Remove Motor info box
AlpenAalAlex Nov 14, 2024
bde2703
Update sidebar when setting geometry type
AlpenAalAlex Nov 22, 2024
939e7b7
Fix Select by Name operator
AlpenAalAlex Nov 22, 2024
8f28ae4
Fix Select Submechanism operator
AlpenAalAlex Nov 27, 2024
e27690a
Merge angle parameters
AlpenAalAlex Nov 28, 2024
1683449
Convert angles when toggling radian checkbox
AlpenAalAlex Nov 28, 2024
9d079b1
Fix submechanism import
AlpenAalAlex Dec 5, 2024
a54ba32
Fix motor import
AlpenAalAlex Dec 5, 2024
1d598fb
Adds valid default export settings
AlpenAalAlex Dec 5, 2024
170e63d
Update phobosgui.py
AlpenAalAlex Dec 5, 2024
3748149
Hide delete button for Add Sensor op
AlpenAalAlex Dec 5, 2024
467e0b6
phobos/core/multiple.py: Check if file is given before calling any ot…
m0rsch1 Feb 6, 2025
f3ab987
phobob/core/multiple.py: file property was asking for a wrong attribu…
m0rsch1 Feb 6, 2025
449a7aa
phobos/core/multiple.py: export entities for SMURFA
m0rsch1 Feb 6, 2025
345cd3e
phobos/io/representation: Fixed position setter which was failing whe…
m0rsch1 Feb 6, 2025
e9cafcd
phobos/scripts/convert.py: Fixed bad argument to robot.export()
m0rsch1 Feb 6, 2025
b4294b6
phobos/core/multiple.py: Retrieve name from file
m0rsch1 Feb 7, 2025
0565203
phobos/core/multiple.py: Added FIXME statement to assemble function
m0rsch1 Feb 7, 2025
a99eec6
phobos/core/multiple.py: The toplvl arrangement name has to be used f…
m0rsch1 Feb 7, 2025
06480dd
Adjusted phobos/scripts/convert.py to properly support SMURFA to dire…
m0rsch1 Feb 12, 2025
31a0e8d
Show resulting origin info
m0rsch1 Feb 17, 2025
99bccdb
Looks like exchange_root() is working (again?) :D
m0rsch1 Feb 18, 2025
a73f6ee
Clean up
m0rsch1 Feb 18, 2025
ce8cba6
Clean up II
m0rsch1 Feb 18, 2025
4d06b4b
When inverting a joint in exchange_root() the axis also has to be tra…
m0rsch1 Feb 18, 2025
e68f91b
Fixed output format detection if path contains a single "."
m0rsch1 Feb 27, 2025
f01e9c5
Fixed double not in phobos/scripts/convert.py
Mar 10, 2025
b835223
Merge pull request #373 from m0rsch1/fix_smurfa_processsing
AlpenAalAlex Mar 11, 2025
48e309f
Fix mesh collision created at world origin #375
AlpenAalAlex Mar 14, 2025
1466865
Fix material creation - Material output missing #375
AlpenAalAlex Mar 18, 2025
7f44fbb
Fix export with mirrored objects #377
AlpenAalAlex Mar 18, 2025
b3a8296
Merge branch 'pre_v2.1.0' into issue338-Exporting-scaled-meshes
AlpenAalAlex Mar 25, 2025
72dde37
Rename parameter to origin_root
AlpenAalAlex Mar 25, 2025
7233312
Merge branch 'pre_v2.1.0' into issue195-Support-for-multiple-degrees-…
AlpenAalAlex Mar 25, 2025
ca53478
Merge branch 'pre_v2.1.0' into aaldev
AlpenAalAlex Mar 25, 2025
424c61a
Merge pull request #348 from AlpenAalAlex/issue212-Add-Motor-function
AlpenAalAlex Mar 25, 2025
b7a253e
Merge pull request #344 from AlpenAalAlex/issue338-Exporting-scaled-m…
AlpenAalAlex Mar 25, 2025
095c1d3
Rename parameter
AlpenAalAlex Mar 25, 2025
bf4a948
Merge pull request #371 from AlpenAalAlex/aaldev
AlpenAalAlex Mar 25, 2025
244dd57
Merge branch 'pre_v2.1.0' into issue195-Support-for-multiple-degrees-…
AlpenAalAlex Mar 25, 2025
3f02485
Update xml_formats.json
AlpenAalAlex Mar 25, 2025
110f7d3
Merge pull request #368 from AlpenAalAlex/issue195-Support-for-multip…
AlpenAalAlex Mar 25, 2025
3e51406
Merge pull request #382 from AlpenAalAlex/issue377-URDF-Export-Error-…
AlpenAalAlex Apr 16, 2025
94ed983
Merge pull request #381 from AlpenAalAlex/issue375-Problems-with-crea…
AlpenAalAlex Apr 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions install_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

extra_requirements = {
"pybullet": "pybullet", # optional for blender
"open3d": "open3d", # optional for blender
"open3d": "open3d", # optional for blender, used for mesh adaption by trimesh
"python-fcl": "python-fcl", # optional for blender
}

Expand All @@ -41,7 +41,11 @@ def install_requirement(package_name, upgrade_pip=False, lib=None, ensure_pip=Tr
lib = bpy.utils.user_resource("SCRIPTS", path="modules")
if ensure_pip:
# Ensure pip is installed
subprocess.check_call([sys.executable, "-m", "ensurepip", "--user"])
try:
subprocess.check_call([sys.executable, "-m", "ensurepip", "--user"])
except subprocess.CalledProcessError:
print("WARNING: We couldn't do ensurepip, we try to continue anyways")
pass
# Update pip (not mandatory)
if upgrade_pip:
print(" Upgrading pip...")
Expand All @@ -60,7 +64,11 @@ def check_requirements(optional=False, extra=False, force=False, upgrade_pip=Fal
return
print("Checking requirements:")
# Ensure pip is installed
subprocess.check_call([sys.executable, "-m", "ensurepip", "--user"])
try:
subprocess.check_call([sys.executable, "-m", "ensurepip", "--user"])
except subprocess.CalledProcessError:
print("WARNING: We couldn't do ensurepip, we try to continue anyways")
pass
reqs = [requirements]
if optional:
reqs += [optional_requirements]
Expand Down
2 changes: 1 addition & 1 deletion manifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<depend package="pyyaml"/><!-- optional="1"/>-->
<!-- Only used for kccd collision export -->
<depend package="control/kccdtools" optional="1"/>
<!-- Only necessary when using the blender add-on-->
<!-- Only necessary when using the blender add-on or for collision mesh processing-->
<depend package="blender" optional="1"/>
<!-- Only used for certain tests-->
<depend package="control/hyrodyn" optional="1" />
Expand Down
12 changes: 11 additions & 1 deletion phobos/blender/io/phobos2blender.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,14 @@ def createGeometry(viscol, geomsrc, linkobj=None):
newgeom = bUtils.createPrimitive(viscol.name, geometry_type, dimensions, phobostype=geomsrc, pmaterial="phobos_collision")
newgeom.select_set(True)
else:
# [TODO] we need to handle here the primitive alternatives that are available when loading from smurf
# They can be returned as second return value to make clear that they are different
# Also they should get another colored material
# When we do this we should add support to edit and create such primitive alternatives
# Also they will currently not be exported.
log(
"Unknown geometry type of "
+ type(geometry)
+ str(type(geometry))
+ viscol.name
+ '. Placing empty coordinate system.',
"ERROR",
Expand Down Expand Up @@ -216,6 +221,11 @@ def createLink(link):
geometries.append((geom, viscol))
for viscol in link.collisions:
geom = createGeometry(viscol, "collision")
if geom is None:
# [TODO] this happens when we load from SMURF if this collision has primitives defined but no mesh
# we need to display those primitive alternatives in Blender, too.
# Yet, we are completely ignoring them
continue
bound_box = (
max(bound_box[0], max([c[0] for c in geom.bound_box])),
max(bound_box[1], max([c[1] for c in geom.bound_box])),
Expand Down
512 changes: 332 additions & 180 deletions phobos/ci/base_model.py

Large diffs are not rendered by default.

357 changes: 202 additions & 155 deletions phobos/ci/model_testing.py

Large diffs are not rendered by default.

332 changes: 194 additions & 138 deletions phobos/ci/pipeline.py

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion phobos/commandline_logging.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import logging
import sys
import os

SUPPORTED_LEVELS = ["DEBUG", "INFO", "WARNING", "ERROR"]
LOGGER_NAME = "phobos_log"
BASE_LOG_LEVEL = "WARNING"
BASE_LOG_LEVEL = os.getenv("PHOBOS_LOG_LEVEL", "WARNING")
LOG_FILE_CONVENTION = None

#The background is set with 40 plus the number of the color, and the foreground with 30
Expand Down
28 changes: 17 additions & 11 deletions phobos/core/multiple.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
from ..io.smurf_reflection import SmurfBase
from ..io.xml_factory import plural as _plural, singular as _singular

from ..commandline_logging import get_logger
log = get_logger(__name__)

__IMPORTS__ = [x for x in dir() if not x.startswith("__")]


Expand Down Expand Up @@ -37,7 +40,7 @@ def __init__(self, name=None, world=None, model=None, file=None, origin=None, fr
for frame in _plural(frames):
self._frames.append(frame)
self.anchor = anchor
self.parent = parent.upper()
self.parent = parent
self.child = child
SmurfBase.__init__(self, name=name, returns=["name", "type", "parent", "position", "rotation", "anchor", "root", "file", "child"], **kwargs)
self.excludes += ["origin", "model"]
Expand Down Expand Up @@ -105,7 +108,7 @@ def position(self):
def position(self, val):
if self.origin is None:
self.origin = representation.Pose()
self.origin.xyz = [val["x"], val["y"], val["z"]]
self.origin.position = val

@property
def rotation(self):
Expand Down Expand Up @@ -169,10 +172,11 @@ def __init__(self, name=None, inputfile=None, entities=None, frames=None, **kwar
Representation.__init__(self)
SmurfBase.__init__(self, returns=["entities"], **kwargs)
self.name = name
self.inputfile = inputfile
self.entities = _plural(entities)
self.inputfile = os.path.abspath(inputfile)
self._frames = _plural(frames)
if self.inputfile is not None:
if self.inputfile is not None:
self.inputfile = os.path.abspath(inputfile)
ext = self.inputfile.lower().rsplit(".", 1)[-1]
if ext == "sdf":
# [Todo v2.1.0]
Expand All @@ -199,6 +203,7 @@ def add_robot(self, name, robot, origin=None, anchor=None):
def add_entity(self, entity):
assert isinstance(entity, Entity)
assert self.get_aggregate("entities", str(entity)) is None, f"There is already an entity with the name {str(entity)}"
log.debug("Adding entity "+ entity.name)
self.entities.append(entity)

def get_aggregate(self, typeName, elem):
Expand Down Expand Up @@ -296,13 +301,13 @@ def assemble(self, root_entity=None):
continue
if entity._anchor == "PARENT":
assert "::" in entity.parent, "Please specify the parent in the way entity::link. Received: "+entity.parent
parent_entity, parent_link = entity.parent.split("::", 1)
parent_entity, parent_link_name = entity.parent.split("::", 1)
else:
assert "::" in entity._anchor, "Please specify the anchor in the way entity::link or use the parent keyword. Received: "+entity._anchor
parent_entity, parent_link = entity._anchor.split("::", 1)
parent_entity, parent_link_name = entity._anchor.split("::", 1)
if parent_entity in [str(e) for e in entities_in_tree]:
parent_link = assembly.get_link(parent_entity+"_"+parent_link)
assert parent_link is not None
parent_link = assembly.get_link(parent_entity+"_"+parent_link_name, verbose=True)
assert parent_link is not None, f"parent link {parent_entity}_{parent_link_name} not found "+str(entity)
if isinstance(root_entity.model, Robot):
attach_model = entity.model.duplicate()
assembly.unlink_from_world()
Expand All @@ -317,13 +322,13 @@ def assemble(self, root_entity=None):
# make sure that we have a consistent downward tree
attach_model.exchange_root(child_link)
attach_model.unlink_from_world()
attach_model.rename_all(prefix=entity.name + "_")
attach_model.rename_all(prefix=entity.name + "_", do_not_double=False)
origin = entity.origin.duplicate()
origin.relative_to = str(entity.origin.relative_to).replace("::", "_", 1)
assembly.attach(
other=attach_model,
joint=representation.Joint(
name=str(parent_entity)+"2"+str(entity),
name=str(parent_entity)+"_2_"+str(entity),
parent=parent_link,
child=child_link,
type="fixed",
Expand All @@ -334,6 +339,7 @@ def assemble(self, root_entity=None):
attached += 1

assembly.link_entities()
assert assembly.verify_meshes()
return assembly

def export_sdf(self, use_includes=True):
Expand Down Expand Up @@ -376,4 +382,4 @@ def expot_smurfs(self, outputfile):
if not os.path.exists(os.path.dirname(outputfile)):
os.makedirs(os.path.dirname(outputfile), exist_ok=True)
with open(outputfile, "w") as f:
f.write(dump_json(out))
f.write(dump_json(out))
Loading