8000 Fixed path issues · ctc-eng/robotics-toolbox-python@2a235f9 · GitHub
[go: up one dir, main page]

Skip to content
< 8000 /div>

Commit 2a235f9

Browse files
committed
Fixed path issues
1 parent d53a0b3 commit 2a235f9

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

ropy/models/PandaURDF.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ class PandaURDF(ETS):
1010

1111
def __init__(self):
1212

13-
fpath = Path('ropy/models/xarco/panda/robots/panda_arm_hand.urdf.xacro')
14-
# fpath = 'ropy/models/xarco/panda/robots/panda_arm.urdf.xacro'
15-
abspath = os.getcwd() + '/ropy/models/xarco/panda/robots/'
13+
fpath = Path('ropy') / 'models' / 'xarco' / 'panda' / 'robots'
14+
fname = 'panda_arm_hand.urdf.xacro'
15+
abspath = fpath.absolute()
1616

17-
args = super(PandaURDF, self).urdf_to_ets_args(fpath)
17+
args = super(PandaURDF, self).urdf_to_ets_args(
18+
(abspath / fname).as_posix())
1819

1920
super(PandaURDF, self).__init__(
2021
args[0],
@@ -31,7 +32,7 @@ def __init__(self):
3132
for link in self.ets:
3233
for gi in link.geometry:
3334
if gi.filename[0] != '/':
34-
gi.filename = abspath + gi.filename
35+
gi.filename = (abspath / gi.filename).as_posix()
3536
# print(link.name)
3637
# print(link.geometry)
3738

ropy/models/UR5.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
#!/usr/bin/env python
22

33
import numpy as np
4-
import os
54
from ropy.robot.ETS import ETS
65
from pathlib import Path
76

8-
import spatialmath as sm
9-
107

118
class UR5(ETS):
129

1310
def __init__(self):
1411

15-
fpath = Path('ropy/models/xarco/ur/urdf/ur5_joint_limited_robot.urdf.xacro')
16-
abspath = os.getcwd() + '/ropy/models/xarco/ur/urdf/'
12+
fpath = Path('ropy') / 'models' / 'xarco' / 'ur' / 'urdf'
13+
fname = 'ur5_joint_limited_robot.urdf.xacro'
14+
abspath = fpath.absolute()
1715

18-
args = super(UR5, self).urdf_to_ets_args(fpath)
16+
args = super(UR5, self).urdf_to_ets_args((abspath / fname).as_posix())
1917

2018
super(UR5, self).__init__(
2119
args[0],
@@ -30,7 +28,7 @@ def __init__(self):
3028
for link in self.ets:
3129
for gi in link.geometry:
3230
if gi.filename[0] != '/':
33-
gi.filename = abspath + gi.filename
31+
gi.filename = (abspath / gi.filename).as_posix()
3432

3533
@property
3634
def qz(self):

0 commit comments

Comments
 (0)
0