-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from maxspahn/ft-slimmer-fk
- Loading branch information
Showing
69 changed files
with
1,522 additions
and
7,069 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Pylint | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- develop | ||
- master | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.8"] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pylint | ||
- name: Analysing the code with pylint | ||
run: | | ||
pylint --fail-under=8 forwardkinematics/* |
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 was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,27 +1,32 @@ | ||
import os | ||
import casadi as ca | ||
import numpy as np | ||
from forwardkinematics.urdfFks.generic_urdf_fk import GenericURDFFk | ||
from forwardkinematics import GenericURDFFk | ||
|
||
absolute_path = os.path.dirname(os.path.abspath(__file__)) | ||
URDF_FILE=absolute_path + "/assets/albert.urdf" | ||
|
||
|
||
def main(): | ||
with open("albert.urdf", "r") as file: | ||
with open(URDF_FILE, "r") as file: | ||
urdf = file.read() | ||
fk = GenericURDFFk(urdf, rootLink='panda_link3', end_link='panda_leftfinger') | ||
fk = GenericURDFFk(urdf, root_link='panda_link3', end_links='panda_leftfinger') | ||
T_0 = np.identity(4) | ||
T_0[0:3, 3] = np.array([0.0, 0.0, 0.0]) | ||
fk.set_mount_transformation(T_0) | ||
n = fk.n() | ||
q_ca = ca.SX.sym('q', n) | ||
q_np = np.zeros(n) | ||
fk_panda_link = fk.fk( | ||
q_ca, "panda_link3", "panda_leftfinger", positionOnly=True | ||
fk_panda_link = fk.casadi( | ||
q_ca, "panda_link3", "panda_leftfinger", position_only=True | ||
) | ||
fk_panda_link_np = fk.fk( | ||
q_np, "panda_link3", "panda_leftfinger", positionOnly=True | ||
fk_panda_link_np = fk.numpy( | ||
q_np, "panda_link3", "panda_leftfinger", position_only=True | ||
) | ||
print(f"casadi fk: {fk_panda_link}") | ||
print(f"numpy fk: {fk_panda_link_np}") | ||
return fk_panda_link, fk_panda_link_np | ||
|
||
|
||
if __name__ == "__main__": | ||
main() | ||
fk_casadi, fk_numpy = main() | ||
print(fk_numpy) | ||
print(fk_casadi) |
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,28 @@ | ||
import os | ||
import casadi as ca | ||
import numpy as np | ||
from forwardkinematics import GenericURDFFk | ||
|
||
absolute_path = os.path.dirname(os.path.abspath(__file__)) | ||
URDF_FILE=absolute_path + "/assets/pointRobot.urdf" | ||
|
||
|
||
def main(): | ||
with open(URDF_FILE, "r") as file: | ||
urdf = file.read() | ||
fk_point_robot = GenericURDFFk( | ||
urdf, | ||
root_link = 'origin', | ||
end_links="base_link", | ||
) | ||
dof = fk_point_robot.n() | ||
q_np = np.random.random(dof) | ||
q_ca = ca.SX.sym("q", dof) | ||
fk_casadi = fk_point_robot.casadi(q_ca, 'base_link', position_only=True) | ||
fk_numpy = fk_point_robot.numpy(q_np, 'base_link', position_only=True) | ||
return fk_casadi, fk_numpy | ||
|
||
if __name__ == "__main__": | ||
fk_casadi, fk_numpy = main() | ||
print(fk_numpy) | ||
print(fk_casadi) |
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,30 @@ | ||
import os | ||
import casadi as ca | ||
import numpy as np | ||
from forwardkinematics import GenericURDFFk | ||
|
||
absolute_path = os.path.dirname(os.path.abspath(__file__)) | ||
URDF_FILE=absolute_path + "/assets/albert.urdf" | ||
|
||
|
||
def main(): | ||
with open(URDF_FILE, "r") as file: | ||
urdf = file.read() | ||
fk_generic = GenericURDFFk( | ||
urdf, | ||
root_link = 'base_link', | ||
end_links="panda_ee", | ||
base_type='diffdrive', | ||
) | ||
dof = fk_generic.n() | ||
q_ca = ca.SX.sym("q", dof) | ||
q_np = np.zeros(dof) | ||
fk_casadi = fk_generic.casadi(q_ca, 'panda_rightfinger', position_only=True) | ||
fk_numpy = fk_generic.numpy(q_np, 'panda_rightfinger', position_only=True) | ||
return fk_casadi, fk_numpy | ||
|
||
|
||
if __name__ == "__main__": | ||
fk_casadi, fk_numpy = main() | ||
print(fk_casadi) | ||
print(fk_numpy) |
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,29 @@ | ||
import os | ||
import casadi as ca | ||
import numpy as np | ||
from forwardkinematics import GenericURDFFk | ||
|
||
absolute_path = os.path.dirname(os.path.abspath(__file__)) | ||
URDF_FILE=absolute_path + "/assets/boxer.urdf" | ||
|
||
|
||
def main(): | ||
with open(URDF_FILE, "r") as file: | ||
urdf = file.read() | ||
fk_generic = GenericURDFFk( | ||
urdf, | ||
root_link = 'base_link', | ||
end_links="ee_link", | ||
base_type='diffdrive', | ||
) | ||
dof = fk_generic.n() | ||
q_ca = ca.SX.sym("q", dof) | ||
q_np = np.random.random(dof) | ||
fk_casadi = fk_generic.casadi(q_ca, parent_link='base_link', child_link='ee_link', position_only=True) | ||
fk_numpy = fk_generic.numpy(q_np, parent_link='base_link', child_link='ee_link', position_only=True) | ||
return fk_casadi, fk_numpy | ||
|
||
if __name__ == "__main__": | ||
fk_casadi, fk_numpy = main() | ||
print(fk_numpy) | ||
print(fk_casadi) |
This file was deleted.
Oops, something went wrong.
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,18 @@ | ||
import numpy as np | ||
import casadi as ca | ||
from forwardkinematics.planarFks.planarArmFk import PlanarArmFk | ||
|
||
|
||
def main(): | ||
fk = PlanarArmFk(10) | ||
q_ca = ca.SX.sym("q", fk.n()) | ||
q_np = np.random.random(fk.n()) | ||
fk_casadi = fk.casadi(q_ca, 5, parent_link=0, position_only=True) | ||
fk_numpy = fk.numpy(q_np, 5, parent_link=4, position_only=True) | ||
return fk_casadi, fk_numpy | ||
|
||
if __name__ == "__main__": | ||
fk_casadi, fk_numpy = main() | ||
print(fk_casadi) | ||
print(fk_numpy) | ||
|
This file was deleted.
Oops, something went wrong.
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,28 @@ | ||
import os | ||
import casadi as ca | ||
import numpy as np | ||
from forwardkinematics import GenericURDFFk | ||
|
||
absolute_path = os.path.dirname(os.path.abspath(__file__)) | ||
URDF_FILE=absolute_path + "/assets/panda.urdf" | ||
|
||
def main(): | ||
with open(URDF_FILE, "r") as file: | ||
urdf = file.read() | ||
fk_panda = GenericURDFFk( | ||
urdf, | ||
root_link = 'panda_link0', | ||
end_links="panda_leftfinger", | ||
) | ||
dof = fk_panda.n() | ||
q_np = np.random.random(dof) | ||
q_ca = ca.SX.sym("q", dof) | ||
fk_casadi = fk_panda.casadi(q_ca, 'panda_rightfinger', position_only=False) | ||
fk_numpy = fk_panda.numpy(q_np, 'panda_leftfinger', position_only=False) | ||
return fk_casadi, fk_numpy | ||
|
||
|
||
if __name__ == "__main__": | ||
fk_casadi, fk_numpy = main() | ||
print(fk_numpy) | ||
print(fk_casadi) |
Oops, something went wrong.