stack-of-tasks / sot-core

Hierarchical task solver plug-in for dynamic-graph
BSD 2-Clause "Simplified" License
19 stars 32 forks source link

__init__.py in robotpkg-py27-sot-core-v3 #138

Closed olivier-stasse closed 4 years ago

olivier-stasse commented 4 years ago

When installing robotpkg-py27-sot-core-v3:

more /opt/openrobots/lib/python2.7/site-packages/dynamic_graph/sot/core/__init__.py

gives:

#
#    Copyright 2010 CNRS
#
#    Author: Florent Lamiraux
#
# This file is free software: you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# This file is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Lesser Public License for more details.  You should have
# received a copy of the GNU Lesser General Public License along with
# this file. If not, see <http://www.gnu.org/licenses/>.

import sys
try:
    from DLFCN import RTLD_NOW, RTLD_GLOBAL
except ModuleNotFoundError:  # Python 3
    from os import RTLD_NOW, RTLD_GLOBAL
import dynamic_graph as dg
flags = sys.getdlopenflags()
# Import C++ symbols in a global scope
# This is necessary for signal compiled in different modules to be compatible
sys.setdlopenflags(RTLD_NOW|RTLD_GLOBAL)
from . import wrap
# Recover previous flags
sys.setdlopenflags(flags)

dg.entity.updateEntityClasses(globals())

when it should be

more ../sot_bionic_ws/install/lib/python2.7/site-packages/dynamic_graph/sot/core/__init__.py
# flake8: noqa
from .exp_moving_avg import *
from .feature_generic import *
from .feature_joint_limits import *
from .feature_point6d import *
from .feature_pose import *
from .feature_position import *
from .feature_position_relative import *
from .feature_posture import *
from .feature_visual_point import *
from .gain_adaptive import *
from .gradient_ascent import *
from .joint_limitator import *
from .kalman import *
from .math_small_entities import *
from .op_point_modifier import *
from .robot_simu import *
from .sot import *
from .task import *
from .task_pd import *
from .visual_point_projecter import *

This is what I have when installing from source. From the binary is does not look like that this repository switch yet to the empty init,py policy (to make it relocatable). @nim65s what do you want to do to fix that. Right now talos_integration_tests assumes the source base behavior (I am currently making the changes for an empty init.py)

olivier-stasse commented 4 years ago

Switching to the empty policy is likely to break several python tests & applications.

olivier-stasse commented 4 years ago

If all the packages have been updated to reflect the current stage, then only talos_integration_tests needs to be updated.

nim65s commented 4 years ago

This file should just not be imported. Where did you find a

from dynamic_graph.sot.core import …

?

olivier-stasse commented 4 years ago

https://github.com/stack-of-tasks/talos_integration_tests/blob/651da8398e8fdab7b4116c7c1d46c41926cde9be/scripts/appli_dcmZmpControl_file.py#L6

nim65s commented 4 years ago

This import is breaking future work on https://github.com/orgs/stack-of-tasks/projects/2

olivier-stasse commented 4 years ago

If this is just a matter of update talos_integration_tests I am fine with it. But to be consistent the source of sot-core should reflect that.

nim65s commented 4 years ago

@olivier-stasse : where are we in this issue ? Did you made any change related to this ? Or should I work on that ?

As a reminder, this issue is currently blocking:

And therefore the next release of eiquadprog & TSID. Blocking TSID Release also happen to block the binary release of pinocchio 2.4.5.

olivier-stasse commented 4 years ago

Fix with commit e88129148 But this will likely breaks some user code even outside robotpkg. We should warn people on the riot channel.