Skip to content
Snippets Groups Projects
Commit 04291003 authored by Guilhem Saurel's avatar Guilhem Saurel Committed by jcarpent
Browse files

[Doc] use os.path.join

parent 092d04f7
No related branches found
No related tags found
No related merge requests found
...@@ -4,9 +4,10 @@ ...@@ -4,9 +4,10 @@
```py ```py
from pinocchio.robot_wrapper import RobotWrapper from pinocchio.robot_wrapper import RobotWrapper
from os.path import join
PKG = '/opt/openrobots/share/' PKG = '/opt/openrobots/share'
URDF = PKG + 'ur5_description/urdf/ur5_gripper.urdf' URDF = join(PKG, 'ur5_description/urdf/ur5_gripper.urdf'@
robot = RobotWrapper(URDF, [PKG]) robot = RobotWrapper(URDF, [PKG])
``` ```
......
...@@ -4,9 +4,10 @@ ...@@ -4,9 +4,10 @@
```py ```py
import pinocchio import pinocchio
from os.path import join
PKG = '/opt/openrobots/share/' PKG = '/opt/openrobots/share'
URDF = PKG + 'ur5_description/urdf/ur5_gripper.urdf' URDF = join(PKG, 'ur5_description/urdf/ur5_gripper.urdf')
robot = pinocchio.robot_wrapper.RobotWrapper(URDF, [PKG]) robot = pinocchio.robot_wrapper.RobotWrapper(URDF, [PKG])
robot.initDisplay(loadModel=True) robot.initDisplay(loadModel=True)
......
...@@ -127,9 +127,10 @@ of pinocchio (available in the homedir of the VBox). ...@@ -127,9 +127,10 @@ of pinocchio (available in the homedir of the VBox).
```py ```py
from pinocchio.robot_wrapper import RobotWrapper from pinocchio.robot_wrapper import RobotWrapper
from os.path import join
PKG = '/opt/openrobots/share' PKG = '/opt/openrobots/share'
URDF = PKG + '/ur5_description/urdf/ur5_gripper.urdf' URDF = join(PKG, 'ur5_description/urdf/ur5_gripper.urdf')
robot = RobotWrapper(URDF, [PKG]) robot = RobotWrapper(URDF, [PKG])
``` ```
......
...@@ -138,11 +138,12 @@ sudo apt install robotpkg-romeo-description ...@@ -138,11 +138,12 @@ sudo apt install robotpkg-romeo-description
Romeo can be loaded with: Romeo can be loaded with:
```py ```py
from os.path import join
import pinocchio as se3 import pinocchio as se3
from pinocchio.romeo_wrapper import RomeoWrapper from pinocchio.romeo_wrapper import RomeoWrapper
PKG = '/opt/openrobots/share' PKG = '/opt/openrobots/share'
URDF = PKG + 'romeo_description/urdf/romeo.urdf' URDF = join(PKG, 'romeo_description/urdf/romeo.urdf')
robot = RomeoWrapper(URDF, [PKG]) # Load urdf model robot = RomeoWrapper(URDF, [PKG]) # Load urdf model
robot.initDisplay(loadModel=True) robot.initDisplay(loadModel=True)
......
...@@ -21,12 +21,13 @@ the tool. They are displayed when the robot moves. ...@@ -21,12 +21,13 @@ the tool. They are displayed when the robot moves.
Example of how to use the robot is has below. Example of how to use the robot is has below.
```py ```py
from os.path import join
import pinocchio as se3 import pinocchio as se3
from mobilerobot import MobileRobotWrapper from mobilerobot import MobileRobotWrapper
from pinocchio.utils import * from pinocchio.utils import *
PKG = '/opt/openrobots/share' PKG = '/opt/openrobots/share'
URDF = PKG + '/ur5_description/urdf/ur5_gripper.urdf' URDF = join(PKG, 'ur5_description/urdf/ur5_gripper.urdf')
robot = MobileRobotWrapper(URDF, [PKG]) robot = MobileRobotWrapper(URDF, [PKG])
robot.initDisplay(loadModel=True) robot.initDisplay(loadModel=True)
......
...@@ -3,6 +3,8 @@ Load 4 times the UR5 model, plus a plate object on top of them, to feature a sim ...@@ -3,6 +3,8 @@ Load 4 times the UR5 model, plus a plate object on top of them, to feature a sim
No optimization, this file is just an example of how to load the models. No optimization, this file is just an example of how to load the models.
''' '''
from os.path import join
from pinocchio import SE3 from pinocchio import SE3
from pinocchio.robot_wrapper import RobotWrapper from pinocchio.robot_wrapper import RobotWrapper
from pinocchio.utils import rotate, zero, eye, se3ToXYZQUAT, urdf from pinocchio.utils import rotate, zero, eye, se3ToXYZQUAT, urdf
...@@ -10,7 +12,7 @@ from pinocchio.utils import rotate, zero, eye, se3ToXYZQUAT, urdf ...@@ -10,7 +12,7 @@ from pinocchio.utils import rotate, zero, eye, se3ToXYZQUAT, urdf
import numpy as np import numpy as np
PKG = '/opt/openrobots/share' PKG = '/opt/openrobots/share'
URDF = PKG + '/ur5_description/urdf/ur5_gripper.urdf' URDF = join(PKG, 'ur5_description/urdf/ur5_gripper.urdf')
def loadRobot(M0, name): def loadRobot(M0, name):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment