Verified Commit aad0c5ae authored by Gabriele Buondonno's avatar Gabriele Buondonno Committed by Justin Carpentier
Browse files

[pythontest] Moved python tests in unittest folder

parent 2ddce615
# NOTE: this example needs gepetto-gui to be installed
# usage: launch gepetto-gui and then run this test
import unittest
import pinocchio as se3
import numpy as np
......@@ -5,15 +8,14 @@ import os
from pinocchio.robot_wrapper import RobotWrapper
# TODO: do not use romeo
current_file = os.path.dirname(os.path.abspath(__file__))
romeo_model_dir = os.path.abspath(os.path.join(current_file, '../models/romeo'))
romeo_model_dir = os.path.abspath(os.path.join(current_file, '../../models/romeo'))
romeo_model_path = os.path.abspath(os.path.join(romeo_model_dir, 'romeo_description/urdf/romeo.urdf'))
hint_list = [romeo_model_dir, "wrong/hint"] # hint list
robot = RobotWrapper(romeo_model_path, hint_list, se3.JointModelFreeFlyer())
robot.initDisplay()
robot.loadDisplayModel("world/pinocchio")
robot.loadDisplayModel("pinocchio")
q0 = np.matrix([
0, 0, 0.840252, 0, 0, 0, 1, # Free flyer
......
import pinocchio as pin
from pinocchio.romeo_wrapper import RomeoWrapper
DISPLAY = False
## Load Romeo with RomeoWrapper
import os
current_path = os.getcwd()
......@@ -24,17 +22,3 @@ q0 = robot.q0
com = robot.com(q0)
# This last command is similar to
com2 = pin.centerOfMass(model,data,q0)
## load model into gepetto-gui
if DISPLAY:
import gepetto.corbaserver
cl = gepetto.corbaserver.Client()
gui = cl.gui
if gui.nodeExists("world"):
gui.deleteNode("world","ON")
robot.initDisplay(loadModel=False)
robot.loadDisplayModel("pinocchio")
robot.display(robot.q0)
gui = robot.viewer.gui
......@@ -9,7 +9,7 @@ ones = lambda n: np.matrix(np.ones([n, 1] if isinstance(n, int) else n), np.doub
# TODO: remove these lines. Do not use RobotWrapper. Do not use URDF
from pinocchio.robot_wrapper import RobotWrapper
current_file = os.path.dirname(os.path.abspath(__file__))
romeo_model_dir = os.path.abspath(os.path.join(current_file, '../models/romeo'))
romeo_model_dir = os.path.abspath(os.path.join(current_file, '../../models/romeo'))
romeo_model_path = os.path.abspath(os.path.join(romeo_model_dir, 'romeo_description/urdf/romeo.urdf'))
hint_list = [romeo_model_dir, "wrong/hint"] # hint list
robot = RobotWrapper(romeo_model_path, hint_list, se3.JointModelFreeFlyer())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment