Commit 1ef6c7e6 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

DynamicPinocchio has dynamic signals

parent 1abef64b
......@@ -12,7 +12,7 @@ BOOST_PYTHON_MODULE(wrap)
bp::import("dynamic_graph");
bp::import("pinocchio");
dg::python::exposeEntity<dgs::DynamicPinocchio>()
dg::python::exposeEntity<dgs::DynamicPinocchio, bp::bases<dg::Entity>, dg::python::AddCommands>()
.add_property("model",
bp::make_function(&dgs::DynamicPinocchio::getModel, reference_existing_object()),
bp::make_function(&dgs::DynamicPinocchio::setModel))
......
......@@ -286,6 +286,7 @@ class AbstractRobot(ABC):
def opposite(v):
return [-x for x in v]
self.dynamic.add_signals()
self.device.setPositionBounds( get(self.dynamic.lowerJl), get(self.dynamic.upperJl))
self.device.setVelocityBounds(-get(self.dynamic.upperVl), get(self.dynamic.upperVl))
self.device.setTorqueBounds (-get(self.dynamic.upperTl), get(self.dynamic.upperTl))
......
......@@ -3,10 +3,9 @@
# Copyright 2011, Florent Lamiraux, Thomas Moulard, JRL, CNRS/AIST
import unittest
import pinocchio
import numpy as np
import pinocchio
from dynamic_graph.sot.dynamic_pinocchio import DynamicPinocchio
from dynamic_graph.sot.dynamic_pinocchio.humanoid_robot import AbstractHumanoidRobot
......@@ -51,19 +50,19 @@ class HumanoidRobotTest(unittest.TestCase):
arobot.dynamic = DynamicPinocchio(self.name + "_dynamic")
arobot.dynamic.setModel(arobot.pinocchioModel)
arobot.dynamic.setData(arobot.pinocchioData)
arobot.dynamic.add_signals()
def get(s):
s.recompute(0)
return s.value
loc_lowerJl=np.array(get(arobot.dynamic.lowerJl))
pin_lowerJl=np.array(arobot.pinocchioModel.lowerPositionLimit[1:len(arobot.pinocchioModel.lowerPositionLimit
)])
loc_lowerJl = np.array(get(arobot.dynamic.lowerJl))
pin_lowerJl = np.array(
arobot.pinocchioModel.lowerPositionLimit[1:len(arobot.pinocchioModel.lowerPositionLimit)])
for i in range(0,len(loc_lowerJl),1):
for i in range(0, len(loc_lowerJl), 1):
if not loc_lowerJl[i] == pin_lowerJl[i]:
self.assertTrue(False,"lowerJl is not working")
self.assertTrue(False, "lowerJl is not working")
def test_build_robot_from_urdf(self):
Robot("test_build_robot_from_string", urdfFile=self.urdf_file_name)
......
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