Skip to content

Commit 6411922

Browse files
authored
Merge pull request #379 from compas-dev/fk_component
Add FK GH component
2 parents ea98dd8 + e2dbbc1 commit 6411922

File tree

6 files changed

+66
-1
lines changed

6 files changed

+66
-1
lines changed

.github/workflows/pr-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ jobs:
1414
- name: Changelog check
1515
uses: Zomzog/[email protected]
1616
with:
17-
fileName: CHANGELOG.rst
17+
fileName: CHANGELOG.md
1818
env:
1919
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
**Added**
1111

12+
* Added `Forward Kinematics` GH component.
13+
1214
**Changed**
1315

1416
**Fixed**
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"""
2+
Calculate the robot's forward kinematic for a given configuration.
3+
4+
COMPAS FAB v0.27.0
5+
"""
6+
from ghpythonlib.componentbase import executingcomponent as component
7+
8+
9+
class ForwardKinematics(component):
10+
def RunScript(self, robot, config, group, link, use_only_model):
11+
frame = None
12+
if robot and config:
13+
options = {}
14+
if link:
15+
options["link"] = link
16+
if use_only_model:
17+
options["solver"] = "model"
18+
frame = robot.forward_kinematics(config, group, options=options)
19+
return frame
2.65 KB
Loading
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"name": "Forward Kinematics",
3+
"nickname": "FK",
4+
"category": "COMPAS FAB",
5+
"subcategory": "Planning",
6+
"description": "Calculate the robot's forward kinematic for a given configuration.",
7+
"exposure": 2,
8+
"ghpython": {
9+
"isAdvancedMode": true,
10+
"iconDisplay": 2,
11+
"inputParameters": [
12+
{
13+
"name": "robot",
14+
"description": "The robot.",
15+
"wireDisplay": "hidden"
16+
},
17+
{
18+
"name": "config",
19+
"description": "The configuration to calculate the forward kinematics for."
20+
},
21+
{
22+
"name": "group",
23+
"description": "The planning group used for calculation. Defaults to the robot's main planning group.",
24+
"typeHintID": "str"
25+
},
26+
{
27+
"name": "link",
28+
"description": "The link name to calculate forward kinematics for. Defaults to the robot's end effector.",
29+
"typeHintID": "str"
30+
},
31+
{
32+
"name": "use_only_model",
33+
"description": "If True, use only the robot model instead of the connected backend to calculate FK.",
34+
"typeHintID": "bool"
35+
}
36+
],
37+
"outputParameters": [
38+
{
39+
"name": "frame",
40+
"description": "The resulting frame."
41+
}
42+
]
43+
}
44+
}
1.02 KB
Loading

0 commit comments

Comments
 (0)