Code Monkey home page Code Monkey logo

hpp-corbaserver's People

Contributors

dianebury avatar florent-lamiraux avatar jmirabel avatar nim65s avatar pfernbach avatar pre-commit-ci[bot] avatar sebastiendalibard avatar thomas-moulard avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

hpp-corbaserver's Issues

Update from hpp-model to hpp-pinocchio

  • Build robots from Python script: should we really keep this ? I would rather use Pinocchio python parser.
  • Joint::linkName() and Joint::linkInJointFrame() have not been implemented. A search is required.

Clean constraint factories

  • the API of each is not very uniform. This was to keep backward compatibility but, at some point, we may want to drop this.
  • it is not possible to make a constraint whose joint n°2 is rigidly attached to the world.

Memory management issue

Servant keys should not be the storage pointer.

This pointer may be deleted and the same address could be given to another object. In this case, the server will think it already has a servant for this pointer and will return the old servant, which is wrong.

Note that this only happens when persistent storage is set to false. A possible fix is to remove the servant from the server map when persistent storage is disabled.

Binding constraints::Implicit::comparisonType

I am unable to bind method hpp::constraints::Implicit::comparisonType. If I add the following lines to
interface Implicit in constraints.idl

    intSeq getComparisonType() raises (Error);
    //-> comparisonType

I get the compilation error below. Of course I expect to get a compilation error from gcc, but I do not understand why omniidl fails to parse those line. If I replace intSeq by floatSeq, omniidl successfully generates python and C++ files and I get later a compilation error which is the expected behavior. I tried several workaround like replacing intSeq by sequence<long> but without any success.

Traceback (most recent call last):
  File "/opt/openrobots/bin/omniidl", line 140, in <module>
    omniidl.main.main()
  File "/opt/openrobots/lib/omniidl/omniidl/main.py", line 451, in main
    bemodules[i].run(tree, backends_args[i])
  File "/home/florent/devel/hpp/src/hpp-corbaserver/cmake-modules/omniidl/cxx_impl/__init__.py", line 235, in run
    main.run(tree)
  File "/home/florent/devel/hpp/src/hpp-corbaserver/cmake-modules/omniidl/cxx_impl/main.py", line 116, in run
    tree.accept(bii)
  File "/opt/openrobots/lib/omniidl/omniidl/idlast.py", line 104, in accept
    def accept(self, visitor): visitor.visitAST(self)
  File "/home/florent/devel/hpp/src/hpp-corbaserver/cmake-modules/omniidl/cxx_impl/main.py", line 334, in visitAST
    n.accept(self)
  File "/opt/openrobots/lib/omniidl/omniidl/idlast.py", line 246, in accept
    def accept(self, visitor): visitor.visitModule(self)
  File "/home/florent/devel/hpp/src/hpp-corbaserver/cmake-modules/omniidl/cxx_impl/main.py", line 312, in visitModule
    n.accept(self)
  File "/opt/openrobots/lib/omniidl/omniidl/idlast.py", line 246, in accept
    def accept(self, visitor): visitor.visitModule(self)
  File "/home/florent/devel/hpp/src/hpp-corbaserver/cmake-modules/omniidl/cxx_impl/main.py", line 312, in visitModule
    n.accept(self)
  File "/opt/openrobots/lib/omniidl/omniidl/idlast.py", line 296, in accept
    def accept(self, visitor): visitor.visitInterface(self)
  File "/home/florent/devel/hpp/src/hpp-corbaserver/cmake-modules/omniidl/cxx_impl/main.py", line 511, in visitInterface
    store_return, do_return = self.retConversion (types.Type(c.returnType()))
  File "/home/florent/devel/hpp/src/hpp-corbaserver/cmake-modules/omniidl/cxx_impl/main.py", line 291, in retConversion
    print ("Unhandled sequence of", innerType.type().name())
AttributeError: Base instance has no attribute 'name'
src/CMakeFiles/generate_idl_cpp.dir/build.make:311: recipe for target 'src/hpp/constraints_idl/constraints-fwd.hh' failed

error: 'Identity' has not been declared

I can't build the devel branch for now:

[ 75%] Building CXX object src/CMakeFiles/hpp-corbaserver.dir/hpp/corbaserver/problemSK.cc.o
cd /local/users/gsaurel/humanoid-path-planner/hpp-corbaserver/build/src && /usr/bin/ccache  g++  -Dhpp_corbaserver_EXPORTS -I/local/users/gsaurel/humanoid-path-planner/hpp-corbaserver/build -I/local/users/gsaurel/humanoid-path-planner/hpp-corbaserver/build/include -I/local/users/gsaurel/humanoid-path-planner/hpp-corbaserver/include -I/local/users/gsaurel/humanoid-path-planner/hpp-corbaserver/build/src -isystem /opt/openrobots/include -isystem /usr/include/assimp -isystem /usr/include/eigen3  -pedantic -Wno-long-long -Wall -Wextra -Wcast-align -Wcast-qual -Wformat -Wwrite-strings -Wconversion  -fPIC   -DURDFDOM_TYPEDEF_SHARED_PTR -DWITH_URDFDOM -DWITH_HPP_FCL -DFCL_USE_ASSIMP_UNIFIED_HEADER_NAMES -DFCL_HAVE_OCTOMAP= -D__x86_64__ -D__linux__ -D__OSVERSION__=2 -Wno-conversion -Wno-cast-qual -Wno-unused-variable -Wno-unused-parameter -o CMakeFiles/hpp-corbaserver.dir/hpp/corbaserver/problemSK.cc.o -c /local/users/gsaurel/humanoid-path-planner/hpp-corbaserver/build/src/hpp/corbaserver/problemSK.cc
/local/users/gsaurel/humanoid-path-planner/hpp-corbaserver/src/robot.impl.cc: In member function ‘hpp::corbaServer::CollisionObjectConstPtr_t hpp::corbaServer::impl::Robot::getObjectByName(const char*)’:
/local/users/gsaurel/humanoid-path-planner/hpp-corbaserver/src/robot.impl.cc:1051:37: error: ‘class hpp::pinocchio::Device’ has no member named ‘nbObjects’
    for (size_type i = 0; i < robot->nbObjects(); ++i) {
                                     ^
/local/users/gsaurel/humanoid-path-planner/hpp-corbaserver/src/robot.impl.cc:1052:55: error: ‘class hpp::pinocchio::Device’ has no member named ‘objectAt’
             CollisionObjectConstPtr_t object = robot->objectAt(i);
                                                       ^
/local/users/gsaurel/humanoid-path-planner/hpp-corbaserver/src/problem.impl.cc: In member function ‘virtual void hpp::corbaServer::impl::Problem::createIdentityConstraint(const char*, const hpp::Names_t&, const hpp::Names_t&)’:
/local/users/gsaurel/humanoid-path-planner/hpp-corbaserver/src/problem.impl.cc:1083:17: error: ‘Identity’ has not been declared
                 Identity::create (ispace, constraintName),
                 ^

Same thing on gepgitlab's CI

Python 3: Using OmniORB 4.2.3 from robotpkg

In order to build HPP with Python 3 support, one must use OmniORB 4.2.3 with Python 3 support. On ubuntu 16.04, it is available via robotpkg-py35-omniorbpy.

When launching hppcorbaserver, I get the following error.

CORBA: CORBA::Exception NO_RESOURCES:IDL:omg.org/CORBA/NO_RESOURCES:1.0 : failed to get the name service

This is due to OmniORB unable to find the correct configuration file. A workaround is to use:

hppcorbaserver -ORBconfigFile /etc/omniORB.cfg

License BSD 2

In agreement with the main authors, we intend to change the license of this package from LGPL-v3 to BSD 2 clauses. A pull request will follow soon to this effect.

Compilation error with gcc 5.4.0

On the master branch (for all hpp packages) I got the following compilation error on ubuntu 16.04 with gcc 5.4 :

[ 40%] Building CXX object src/CMakeFiles/hpp-corbaserver.dir/hpp/core_idl/distances.cc.o
cd /local/dev_hpp/src/hpp-corbaserver/build-rel/src && /usr/bin/c++   -DBOOST_MPL_LIMIT_LIST_SIZE=30 -DBOOST_MPL_LIMIT_VECTOR_SIZE=30 -DPINOCCHIO_WITH_HPP_FCL -DPINOCCHIO_WITH_URDFDOM -Dhpp_corbaserver_EXPORTS -I/local/dev_hpp/src/hpp-corbaserver/build-rel -I/local/dev_hpp/src/hpp-corbaserver/build-rel/include -I/local/dev_hpp/src/hpp-corbaserver/include -I/local/dev_hpp/src/hpp-corbaserver/build-rel/src -isystem /opt/openrobots/include -isystem /local/dev_hpp/install/include -isystem /usr/include/eigen3 -isystem /usr/include/assimp  -pedantic -Wno-long-long -Wall -Wextra -Wcast-align -Wcast-qual -Wformat -Wwrite-strings -Wconversion  -O3 -DNDEBUG -fPIC   -D__x86_64__ -D__linux__ -D__OSVERSION__=2 -DHPP_FCL_HAVE_OCTOMAP -DFCL_HAVE_OCTOMAP -DOCTOMAP_MAJOR_VERSION=1 -DOCTOMAP_MINOR_VERSION=9 -DOCTOMAP_PATCH_VERSION=0 -std=gnu++11 -o CMakeFiles/hpp-corbaserver.dir/hpp/core_idl/distances.cc.o -c /local/dev_hpp/src/hpp-corbaserver/build-rel/src/hpp/core_idl/distances.cc
/local/dev_hpp/src/hpp-corbaserver/build-rel/src/hpp/core_idl/distances.cc:11:64: error: specialization of ‘template<class ServantBaseType> std::vector<hpp::corbaServer::ServantFactoryBase<ServantBaseType>*>& hpp::corbaServer::objectDowncasts()’ in different namespace [-fpermissive]
 ::hpp::corbaServer::objectDowncasts<hpp::core_impl::Distance> ()
                                                                ^
In file included from /local/dev_hpp/src/hpp-corbaserver/build-rel/src/hpp/core_idl/distances-fwd.hh:9:0,
                 from /local/dev_hpp/src/hpp-corbaserver/build-rel/src/hpp/core_idl/distances.hh:8,
                 from /local/dev_hpp/src/hpp-corbaserver/build-rel/src/hpp/core_idl/distances.cc:5:
/local/dev_hpp/src/hpp-corbaserver/include/hpp/corbaserver/servant-base.hh:348:58: error:   from definition of ‘template<class ServantBaseType> std::vector<hpp::corbaServer::ServantFactoryBase<ServantBaseType>*>& hpp::corbaServer::objectDowncasts()’ [-fpermissive]
     std::vector< ServantFactoryBase<ServantBaseType>* >& objectDowncasts ();
                                                          ^
src/CMakeFiles/hpp-corbaserver.dir/build.make:873 : la recette pour la cible « src/CMakeFiles/hpp-corbaserver.dir/hpp/core_idl/distances.cc.o » a échouée

After quick search it looks like a bug in gcc <= 7.0 that do not correctly implement the c++11 standard. Compilation with Clang (3.8) work correctly.
It seems that some fix exist to avoid this (https://stackoverflow.com/questions/25594644/warning-specialization-of-template-in-different-namespace) but I did not try them.

Running tests in docker

omniName service must be running to launch the tests, and it doesn't seem to work on docker for now:

$ rm -v /var/log/omniorb*
removed '/var/log/omniorb-nameserver.log'
$ service omniorb4-nameserver restart
 * Restarting omniORB name server:  omniNames
   ...done.
$ ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  5.0  0.0  18224  3020 ?        Ss   13:37   0:00 /bin/bash
root         9  0.0  0.0  18320  2784 ?        S    13:37   0:00 /bin/bash
root        21  0.0  0.0   4376    88 ?        R    13:37   0:00 start-stop-daemon --start --quiet --background --pidfile /var/run/omniNames.pid --make-pidfile --exec /usr/bin/omniNames -- -errlog /var/log/omniorb-nameserver.log
root        22  0.0  0.0  34424  2896 ?        R    13:37   0:00 ps aux
$ ctest -VV
UpdateCTestConfiguration  from :/root/robotpkg/path/hpp-corbaserver/work.runner-e7e27102-project-224-concurrent-3/hpp-corbaserver-4.2.0/build/DartConfiguration.tcl
UpdateCTestConfiguration  from :/root/robotpkg/path/hpp-corbaserver/work.runner-e7e27102-project-224-concurrent-3/hpp-corbaserver-4.2.0/build/DartConfiguration.tcl
Test project /root/robotpkg/path/hpp-corbaserver/work.runner-e7e27102-project-224-concurrent-3/hpp-corbaserver-4.2.0/build
Constructing a list of tests
Done constructing a list of tests
Checking test dependency graph...
Checking test dependency graph end
test 1
    Start 1: robot.py

1: Test command: /usr/bin/python2.7 "/root/robotpkg/path/hpp-corbaserver/work.runner-e7e27102-project-224-concurrent-3/hpp-corbaserver-4.2.0/tests/robot.py"
1: Environment variables: 
1:  PYTHONPATH=/root/robotpkg/path/hpp-corbaserver/work.runner-e7e27102-project-224-concurrent-3/hpp-corbaserver-4.2.0/build/src:/usr/lib/omniidl/omniidl_be
1: Test timeout computed to be: 9.99988e+06
1: E
1: ======================================================================
1: ERROR: test_createRobotFromPython (__main__.Test)
1: ----------------------------------------------------------------------
1: Traceback (most recent call last):
1:   File "/root/robotpkg/path/hpp-corbaserver/work.runner-e7e27102-project-224-concurrent-3/hpp-corbaserver-4.2.0/tests/robot.py", line 18, in setUp
1:     self.client = Client()
1:   File "/root/robotpkg/path/hpp-corbaserver/work.runner-e7e27102-project-224-concurrent-3/hpp-corbaserver-4.2.0/build/src/hpp/corbaserver/client.py", line 66, in __init__
1:     self.rootContext = obj._narrow(CosNaming.NamingContext)
1:   File "/usr/lib/python2.7/dist-packages/omniORB/CORBA.py", line 798, in _narrow
1:     return _omnipy.narrow(self, repoId, 1)
1: TRANSIENT: CORBA.TRANSIENT(omniORB.TRANSIENT_ConnectFailed, CORBA.COMPLETED_NO)
1: 
1: ----------------------------------------------------------------------
1: Ran 1 test in 0.017s
1: 
1: FAILED (errors=1)
1/1 Test #1: robot.py .........................***Failed    0.13 sec

Cannot use two ServerManager in same script

It is currently not possible to use ServerManager and create a client several times in the same file.

This simple script does not work:

from hpp.utils import ServerManager
import hpp.corbaserver

with ServerManager():
    cl1 = hpp.corbaserver.Client()

with ServerManager():
    cl2 = hpp.corbaserver.Client()

It gives the following error:

'Failed to narrow client at corbaloc:iiop:localhost:13331/hpp-corbaserver into hpp_idl.hpp.Tools: CORBA.COMM_FAILURE(omniORB.COMM_FAILURE_WaitingForReply, CORBA.COMPLETED_MAYBE)'
---------------------------------------------------------------------------
TRANSIENT                                 Traceback (most recent call last)
Input In [4], in <cell line: 1>()
      1 with ServerManager():
----> 2     cl = hpp.corbaserver.Client()

File /opt/openrobots/lib/python3.8/site-packages/hpp/corbaserver/client.py:113, in Client.__init__(self, clients, url, context, host, port)
     97 def __init__(
     98     self,
     99     clients=defaultClients,
   (...)
    103     port=None,
    104 ):
    105     """
    106     Initialize CORBA and create default clients.
    107     :param url: URL in the IOR, corbaloc, corbalocs, and corbanames formats.
   (...)
    111                 "corbaloc:iiop:" + str(host) + "/NameService"
    112     """
--> 113     self._initOrb(url, host, port)
    114     self._makeClients("", clients, context)

File /opt/openrobots/lib/python3.8/site-packages/hpp/corbaserver/client.py:146, in Client._initOrb(self, url, host, port)
    144     pass
    145 if self._tools is None:
--> 146     self.initWithNameService(urlNameService)

File /opt/openrobots/lib/python3.8/site-packages/hpp/corbaserver/client.py:52, in Client.initWithNameService(self, urlNameService)
     50 def initWithNameService(self, urlNameService):
     51     obj = self.orb.string_to_object(urlNameService)
---> 52     self.rootContext = obj._narrow(CosNaming.NamingContext)
     53     if self.rootContext is None:
     54         raise CorbaError("Failed to narrow the root context")

File /opt/openrobots/lib/python3.8/site-packages/omniORB/CORBA.py:583, in Object._narrow(self, dest)
    580 except KeyError:
    581     pass
--> 583 return self._obj.narrow(repoId, 1)

TRANSIENT: CORBA.TRANSIENT(omniORB.TRANSIENT_ConnectFailed, CORBA.COMPLETED_NO)

Note that when using ServerManager but not creating a client, there is no error.

I suppose it is because the hppcorbaserver does not get properly killed when leaving the context manager. When looking at htop output in another terminal, between the two context managers, there is a phantom unkillable hppcorbaserver process. The only way to kill it is to kill the parent process, that is the python interpreter that launched the script.

Idl interface Robot::loadRobotModel is limited

In the current version of the package, idl interface functions

  • Robot::loadRobotModel, and
  • Robot::loadHumanoidRobotModel
    make the asumption that the urdf and srdf files are located in directories called respectively "urdf" and "srdf" and located in the "package://something" directory.
    This asumption is constraining and is broken by the recent introduction of package example-robot-data.
    I propose to change the prototypes of these functions in such a way that they take as input urdf and srdf filenames. This will break the idl API. However, it is very likely that nobody uses directly this API, since it is wrapped by the python class Robot.

@stonneau, @pFernbach, due you use this API to load robots or do you use python class Robot and derived classes.

Unfortunately, IDL dos not support function overloading and therefore, the usual deprecation method is not possible to implement.

AttributeError: attribute '__doc__' of 'type' objects is not writable on 18.04

Hi,

The test py-robot does not pass on 18.04 after #75, with the following error:

2/2 Test #1: py-robot .........................***Failed    0.24 sec
Traceback (most recent call last):
  File "…/tests/robot.py", line 6, in <module>
    from hpp.corbaserver import Client
  File "…/src/hpp/corbaserver/__init__.py", line 1, in <module>
    from .client import Client
  File "…/src/hpp/corbaserver/client.py", line 8, in <module>
    import hpp_idl.hpp.corbaserver
  File "…/src/hpp_idl/hpp/__init__.py", line 11, in <module>
    import hpp_stubs.corbaserver.robot_idl
  File "…/src/hpp_stubs/corbaserver/robot_idl.py", line 495, in <module>
    _0_hpp.corbaserver._objref_Robot.__doc__ = _0_hpp.corbaserver.Robot__doc__
AttributeError: attribute '__doc__' of 'type' objects is not writable

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.