Skip to content

Commit 1dedfd9

Browse files
authored
Merge pull request #457 from ebruun/ghpython_component_fix_bruun
ghpython vizualize trajectory component fix
2 parents c48502e + 6c81021 commit 1dedfd9

File tree

10 files changed

+41
-18
lines changed

10 files changed

+41
-18
lines changed

.github/workflows/integration.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
- name: Install
3232
run: |
3333
python -m pip install --no-cache-dir -r requirements-dev.txt
34+
pip install --no-cache-dir -e .
3435
- name: Run integration tests
3536
run: |
3637
pytest --doctest-modules

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Added
1111

1212
### Changed
13+
* Replaced the deprecated `draw_frame` function with `frame_to_rhino_plane` in the *Visualize Trajectory* GhPython component to restore correct frame visualization.
1314

1415
### Removed
1516

CONTRIBUTING.rst

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,28 @@ We love pull requests from everyone! Here's a quick guide to improve the code:
1212

1313
1. Fork `the repository <https://github.com/compas-dev/compas_fab>`_ and clone the fork.
1414
2. Create a virtual environment using your tool of choice (e.g. ``virtualenv``, ``conda``, etc).
15-
3. Install development dependencies:
15+
3. Install the development dependencies:
1616

1717
::
1818

1919
pip install -r requirements-dev.txt
20+
pip install -e .
2021

21-
4. From the `compas_fab` directory, run the docker containers:
22+
.. note::
23+
24+
**Windows users:** The ``pybullet`` package often fails to build from source when installed
25+
via ``pip`` due to missing C++ build tools.
26+
To avoid this, **comment out the ``pybullet`` line in ``requirements-dev.txt``** before running
27+
``pip install -r requirements-dev.txt`` and then install ``pybullet`` separately using:
28+
29+
::
30+
31+
conda install -c conda-forge pybullet
32+
33+
This ensures that the precompiled conda-forge package is used instead of attempting
34+
to compile ``pybullet`` from source.
35+
36+
1. From the `compas_fab` directory, run the docker containers:
2237

2338
::
2439

@@ -30,6 +45,16 @@ We love pull requests from everyone! Here's a quick guide to improve the code:
3045

3146
invoke test --doctest --codeblock
3247

48+
.. note::
49+
50+
If you see the error ``No idea what '--codeblock' is!'', it means your version of the
51+
task definitions does not support the ``--codeblock`` option.
52+
In that case, simply remove ``--codeblock`` and run:
53+
54+
::
55+
56+
invoke test --doctest
57+
3358
6. Start making your changes to the **main** branch (or branch off of it).
3459
7. Make sure all tests still pass:
3560

src/compas_fab/ghpython/components/Cf_RosRobot/code.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@
44
COMPAS FAB v1.1.2
55
"""
66

7+
from compas.scene import SceneObject
78
from compas_ghpython import create_id
89
from ghpythonlib.componentbase import executingcomponent as component
910
from scriptcontext import sticky as st
1011

11-
from compas.scene import SceneObject
12-
1312

1413
class ROSRobot(component):
1514
def RunScript(self, ros_client, load):

src/compas_fab/ghpython/components/Cf_VisualizeRobot/code.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66

77
import time
88

9+
from compas.geometry import Frame
10+
from compas.geometry import Transformation
11+
from compas.scene import SceneObject
912
from compas_ghpython import create_id
1013
from compas_rhino.conversions import frame_to_rhino_plane
1114
from ghpythonlib.componentbase import executingcomponent as component
1215
from scriptcontext import sticky as st
1316

14-
from compas.geometry import Frame
15-
from compas.geometry import Transformation
16-
from compas.scene import SceneObject
1717
from compas_fab.backends import BackendFeatureNotSupportedError
1818
from compas_fab.robots import PlanningScene
1919

src/compas_fab/ghpython/components/Cf_VisualizeTrajectory/code.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
COMPAS FAB v1.1.2
55
"""
66

7-
from compas_ghpython import draw_frame
87
from compas_ghpython.sets import list_to_ghtree
8+
from compas_rhino.conversions import frame_to_rhino_plane
99
from ghpythonlib.componentbase import executingcomponent as component
1010

1111

@@ -29,7 +29,7 @@ def RunScript(self, robot, group, trajectory):
2929
robot.merge_group_with_full_configuration(c, trajectory.start_configuration, group)
3030
)
3131
frame = robot.forward_kinematics(c, group, options=dict(solver="model"))
32-
planes.append(draw_frame(frame))
32+
planes.append(frame_to_rhino_plane(frame))
3333
positions.append(c.positions)
3434
velocities.append(c.velocities)
3535
accelerations.append(c.accelerations)

src/compas_fab/ghpython/components_cpython/Cf_RosRobot/code.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@
66
"""
77

88
import Grasshopper
9+
from compas.scene import SceneObject
910
from compas_ghpython import create_id
1011
from scriptcontext import sticky as st
1112

12-
from compas.scene import SceneObject
13-
1413

1514
class ROSRobot(Grasshopper.Kernel.GH_ScriptInstance):
1615
def RunScript(self, ros_client, load):

src/compas_fab/ghpython/components_cpython/Cf_VisualizeRobot/code.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
import time
99

1010
import Grasshopper
11+
from compas.geometry import Frame
12+
from compas.geometry import Transformation
13+
from compas.scene import SceneObject
1114
from compas_ghpython import create_id
1215
from compas_rhino.conversions import frame_to_rhino_plane
1316
from scriptcontext import sticky as st
1417

15-
from compas.geometry import Frame
16-
from compas.geometry import Transformation
17-
from compas.scene import SceneObject
1818
from compas_fab.backends import BackendFeatureNotSupportedError
1919
from compas_fab.robots import PlanningScene
2020

src/compas_fab/ghpython/reachabilitymapobject.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
from compas_ghpython.scene import GHSceneObject
2-
31
from compas.colors import ColorMap
42
from compas.scene import SceneObject
3+
from compas_ghpython.scene import GHSceneObject
54

65

76
class ReachabilityMapObject(GHSceneObject):

src/compas_fab/rhino/reachabilitymapobject.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
from compas_rhino.scene import RhinoSceneObject
2-
31
from compas.colors import ColorMap
42
from compas.scene import SceneObject
3+
from compas_rhino.scene import RhinoSceneObject
54

65

76
class ReachabilityMapObject(RhinoSceneObject):

0 commit comments

Comments
 (0)