jrl-umi3218 / lipm_walking_controller

Walking controller based on linear inverted pendulum tracking
BSD 2-Clause "Simplified" License
18 stars 11 forks source link

The "Corba" plugin for "NameServerView" and The "OpenRTM" plugin for "RTSNameServerView" are not found #14

Closed zahednejad203 closed 4 years ago

zahednejad203 commented 4 years ago

Hi, When I run choreonoid --start-simulation sim_cm.cnoid on ubuntu 16.0.4 I get the following errors and the robot fall on the ground :

Error: The "Corba" plugin for "NameServerView" is not found. The view cannot be restored.
Error: The "OpenRTM" plugin for "RTSNameServerView" is not found. The view cannot be restored.

Here is a full log of Choreonoid:

The Eigen library version 3.2.92 is used (SIMD intruction sets in use: SSE, SSE2).
Detecting plugin file "/usr/local/bin/../lib/choreonoid-1.8/libCnoidPythonSimScriptPlugin.so"
Detecting plugin file "/usr/local/bin/../lib/choreonoid-1.8/libCnoidAssimpPlugin.so"
Detecting plugin file "/usr/local/bin/../lib/choreonoid-1.8/libCnoidPoseSeqPlugin.so"
Detecting plugin file "/usr/local/bin/../lib/choreonoid-1.8/libCnoidPythonPlugin.so"
Detecting plugin file "/usr/local/bin/../lib/choreonoid-1.8/libCnoidBodyPlugin.so"
Detecting plugin file "/usr/local/bin/../lib/choreonoid-1.8/libCnoidBalancerPlugin.so"
Body customizer "/usr/local/bin/../lib/choreonoid-1.8/customizer/Labo1Customizer.so" for Labo1 has been loaded.
Body-plugin has been activated.
Assimp-plugin has been activated.
PoseSeq-plugin has been activated.
Python-plugin has been activated.
PythonSimScript-plugin has been activated.
Balancer-plugin has been activated.
Loading project file "sim_mc.cnoid" ...
Task sequencer '' has been deactivated.
Error: The "Corba" plugin for "NameServerView" is not found. The view cannot be restored.
Error: The "OpenRTM" plugin for "RTSNameServerView" is not found. The view cannot be restored.
OpenGL 3.3 (VMware, Inc. llvmpipe (LLVM 6.0, 256 bits), GLSL 3.30) is available for the "Scene" view.
 Shadow casting is disabled for this GPU due to some problems.
PythonPlugin: "/usr/local/bin/../lib/python2.7/dist-packages/hrpsys" has been added to the Python module search path list.
Restoring ExtCommandItem "ModelLoader"
External command "openhrp-model-loader" has been executed by item "ModelLoader".
Restoring WorldItem "World"
ready
Restoring BodyItem "JVRC1"
Loading Body "/usr/local/share/OpenHRP-3.1/robot/JVRC1/main.wrl"
 -> ok!
Error: OpenRTMPlugin is not loaded.
Error: BodyRTCItem of OpenRTMPlugin is not a registered item type.
Error: "BodyRTC" cannot be restored.
Restoring SensorVisualizer "SensorVisualizer"
Restoring BodyItem "longfloor"
Loading Body "/usr/local/share/OpenHRP-3.1/sample/model/longfloor.wrl"
 -> ok!
Restoring AISTSimulatorItem "AISTSimulator"
Restoring PythonSimScriptItem "sim_mc.py"
Loading Python Script for Simulation "/usr/local/share/hrpsys/samples/JVRC1/sim_mc.py"
 -> ok!
7 / 8 item(s) have been loaded.
Warning: 1 item(s) were not loaded.
Project "sim_mc.cnoid" has been partially loaded.
Simulation by AISTSimulator has started.
Execution of Python script "sim_mc.py" has been started.
The execution of Python script "sim_mc.py" failed.
ImportError: No module named 'omniORB'

At:
  /usr/local/bin/../lib/python2.7/dist-packages/hrpsys/rtm.py(1): <module>
  <frozen importlib._bootstrap>(222): _call_with_frames_removed
  <frozen importlib._bootstrap_external>(665): exec_module
  <frozen importlib._bootstrap>(673): _load_unlocked
  <frozen importlib._bootstrap>(958): _find_and_load_unlocked
  <frozen importlib._bootstrap>(969): _find_and_load
  /usr/local/share/hrpsys/samples/JVRC1/sim_mc.py(3): <module>

Any thoughts ?

gergondet commented 4 years ago

Did you build choreonoid from source? If so you need to enable the OpenRTM plugin

elfalko commented 4 years ago

Hi, I'm hanging at the same issue. I also built chorenoid from source, and fixed the issue with Corba by installing openORM and enabling it by rebuilding with -DBUILD_CORBA_PLUGIN=ON -DENABLE_CORBA=ON. That took care of first error line. I then tried activating the OpenRTM with -DBUILD_OPENRTM_PLUGIN=ON (which is documented in chorenoid) and -DENABLE_OPENRTM=ON (which was just a guess from my part. However, CMake always warns me that both latter options are not actually used in the build process. What am I missing here to solve Error: The "OpenRTM" plugin for "RTSNameServerView" is not found. The view cannot be restored.?

gergondet commented 4 years ago

Hi,

If you are building choreonoid from source and you are using a recent version you'll need to add the OpenRTM plugin and OpenHRP-plugin in the ext folder:

I think #18 is related to not having those plugins (assuming the file the project is trying to open do exist)

elfalko commented 4 years ago

This got me a step further, but everytime I recompile I'm recompiling chorenoid I now run into the error:

    [ 77%] Building CXX object src/BodyPlugin/CMakeFiles/CnoidBodyPlugin.dir/SubSimulatorItem.cpp.o
    /home/f/devel1/choreonoid/ext/choreonoid-openrtm/sample/VisionSensorIoRTC.cpp: In member function ‘void CameraIo::outputImage()’:
    /home/f/devel1/choreonoid/ext/choreonoid-openrtm/sample/VisionSensorIoRTC.cpp:384:55: error: ‘jpeg_mem_dest’ was not declared in this scope
             jpeg_mem_dest(&cinfo, &outbuffer, &writtenSize);
                                                          ^

I already tried to apply your PR on chorenoid-openrpm and installing libjpeg8. I will probably just omit the sample file next

elfalko commented 4 years ago

I read up on libjpeg8 and libjpeg-turbo 8 some more.

This was the best explanation of where to get 'jpeg_mem_dest' I could find:

In-Memory Source/Destination Managers explanation **By default, libjpeg-turbo 1.3 and later includes the jpeg_mem_src() and jpeg_mem_dest() functions, even when not emulating the libjpeg v8 API/ABI.** Previously, it was necessary to build libjpeg-turbo from source with libjpeg v8 API/ABI emulation in order to use the in-memory source/destination managers, but several projects requested that those functions be included when emulating the libjpeg v6b API/ABI as well. **This allows the use of those functions by programs that need them, without breaking ABI compatibility for programs that don't, and it allows those functions to be provided in the "official" libjpeg-turbo binaries.** Those who are concerned about maintaining strict conformance with the libjpeg v6b or v7 API can pass an argument of -DWITH_MEM_SRCDST=0 to cmake prior to building libjpeg-turbo. This will restore the pre-1.3 behavior, in which jpeg_mem_src() and jpeg_mem_dest() are only included when emulating the libjpeg v8 API/ABI. On Un*x systems, including the in-memory source/destination managers changes the dynamic library version from 62.2.0 to 62.3.0 if using libjpeg v6b API/ABI emulation and from 7.2.0 to 7.3.0 if using libjpeg v7 API/ABI emulation. Note that, on most Un*x systems, the dynamic linker will not look for a function in a library until that function is actually used. Thus, if a program is built against libjpeg-turbo 1.3+ and uses jpeg_mem_src() or jpeg_mem_dest(), that program will not fail if run against an older version of libjpeg-turbo or against libjpeg v7- until the program actually tries to call jpeg_mem_src() or jpeg_mem_dest().

From apt show libjpeg-turbo8 I learned got the following

        Replaces: libjpeg8 (<< 8c-2ubuntu5)

Since libjpeg-turbo8 is installed at version 1.4.2, combined with the explanation above my libjpeg-turbo8 should provide the function. So I'm not sure why my build process is complaining.

gergondet commented 4 years ago

Do you have libjpeg-turbo8-dev? (which OS are you building on by the way?)

Anyway you can skip these samples by setting BUILD_CHOREONOID_OPENRTM_SAMPLES to OFF. I don't think this will affect your ability to use mc_openrtm

elfalko commented 4 years ago

I'm building on Ubuntu 16.04.

I tried installing libjpeg-turbo8-dev (with choreonoid openrtm build samples). The build steps of chorenoid went through, but running choreonoid --start-simulation sim_mc.cnoid as described in the simulation instructions I just get a segfault. Segmentation fault (core dumped) The same happens if I omit building the choreonoid openrtm samples. Unfortunately that means the choreonoid window does not open, so I cannot post a proper log.

arntanguy commented 4 years ago

Hi,

You should have a clear-omninames.sh script in share/hrpsys/samples/JVRC1, make sure you run it before trying to run choreonoid. This script clears the omniname server cache and restarts it. It seems that omniorb doesn't deal well with non-fixed IP, and this script must be run everytime your IP address changes. And sadly, choreonoid doesn't handle this issue gracefully and just plainly segfaults.

Let me know if that doesn't solve your segmentation fault issue.

elfalko commented 4 years ago

assuming you meant /usr/share/hrpsys/samples/JVRC1, I already tried that to no avail, unfortunately. The issue still remains.

I'm linking the outputs of my commands, maybe you spot something I'm missing.

window `roslaunch mc_rtc_ticker display.launch` ```bash f@Ub16Blue:~$ roslaunch mc_rtc_ticker display.launch ... logging to /home/f/.ros/log/f227a74a-c5ba-11ea-b72d-2c4d545317fc/roslaunch-Ub16Blue-7082.log Checking log directory for disk usage. This may take awhile. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB. started roslaunch server http://Ub16Blue:34845/ SUMMARY ======== PARAMETERS * /rosdistro: kinetic * /rosversion: 1.12.14 NODES / rviz (rviz/rviz) auto-starting new master process[master]: started with pid [7092] ROS_MASTER_URI=http://localhost:11311 setting /run_id to f227a74a-c5ba-11ea-b72d-2c4d545317fc process[rosout-1]: started with pid [7105] started core service [/rosout] process[rviz-2]: started with pid [7120] [ INFO] [1594721731.379085877]: rviz version 1.12.17 [ INFO] [1594721731.379122221]: compiled against Qt version 5.5.1 [ INFO] [1594721731.379130061]: compiled against OGRE version 1.9.0 (Ghadamon) [ INFO] [1594721731.881672796]: Stereo is NOT SUPPORTED [ INFO] [1594721731.881756904]: OpenGl version: 4.6 (GLSL 4.6). 0x14823d0 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0xa87d30) ): Attempt to set a screen on a child window. 0x1481450 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0xa87d30) ): Attempt to set a screen on a child window. 0x1481f30 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0xa87d30) ): Attempt to set a screen on a child window. 0x149ae70 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0xa87d30) ): Attempt to set a screen on a child window. [info] Connected SUB socket to ipc:///tmp/mc_rtc_pub.ipc [info] Connected PUSH socket to ipc:///tmp/mc_rtc_rep.ipc ```
window chorenoid ```bash f@Ub16Blue:/usr/share/hrpsys/samples/JVRC1$ ./clear-omninames.sh [sudo] password for f: Stopping omniorb4-nameserver (via systemctl): omniorb4-nameserver.service. Starting omniorb4-nameserver (via systemctl): omniorb4-nameserver.service. Tue Jul 14 12:14:18 2020: Starting omniNames for the first time. Wrote initial log file. Read log file successfully. Root context is IOR:010000002b00000049444c3a6f6d672e6f72672f436f734e616d696e672f4e616d696e67436f6e746578744578743a312e300000010000000000000070000000010102000e0000003139322e3136382e302e31393700f90a0b0000004e616d6553657276696365000300000000000000080000000100000000545441010000001c0000000100000001000100010000000100010509010100010000000901010003545441080000007a850d5f01001b61 Checkpointing Phase 1: Prepare. Checkpointing Phase 2: Commit. Checkpointing completed. f@Ub16Blue:/usr/share/hrpsys/samples/JVRC1$ choreonoid --start-simulation sim_mc.cnoid Segmentation fault (core dumped) ```

and my ~/.config/mc_rtc/mc_rtc.yaml:

{
  "MainRobot": "JVRC1",
  "Enabled": ["LIPMWalking"]
}
arntanguy commented 4 years ago

It seems that choreonoid itself is segfaulting, way before anything remotely related to mc_rtc and the LIPMWalking controller (those are only started after choreonoid window is open and the simulation is running, and you'd see related outputs in the terminal).

Thus there is something wrong with your choreonoid installation. Unfortunately, that'll be hard to debug remotely. Some things I'd check:

If you don't manage to get your compiled version to work, we also provide packages for choreonoid. However, if you do decide to use those, make sure you remove everything that was manually installed first, as you're very likely to run into issues otherwise. Note that this will also install mc_openrtm from packages, so you'll want to remove the compiled version from /usr/local

# Make sure you have required tools
sudo apt-get -qq install apt-transport-https lsb-release ca-certificates gnupg
# Add our key
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key 892EA6EE273707C6495A6FB6220D644C64666806
# Add our repository (head versions)
sudo sh -c 'echo "deb https://dl.bintray.com/gergondet/multi-contact-head $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/multi-contact.list'
sudo apt-get -qq update
sudo apt install jvrc-choreonoid
elfalko commented 4 years ago

gergondet suggested I might be missing the following plugins:

I'll try your instructions on a new setup and see what that returns.

elfalko commented 4 years ago
chorenoid log after startup ```bash Detecting plugin file "/usr/lib/choreonoid-1.7/libCnoidPythonPlugin.so" Detecting plugin file "/usr/lib/choreonoid-1.7/libCnoidOpenRTMPlugin.so" Detecting plugin file "/usr/lib/choreonoid-1.7/libCnoidPoseSeqPlugin.so" Detecting plugin file "/usr/lib/choreonoid-1.7/libCnoidCorbaPlugin.so" Detecting plugin file "/usr/lib/choreonoid-1.7/libCnoidRobotAccessPlugin.so" Detecting plugin file "/usr/lib/choreonoid-1.7/libCnoidPythonSimScriptPlugin.so" Detecting plugin file "/usr/lib/choreonoid-1.7/libCnoidBalancerPlugin.so" Detecting plugin file "/usr/lib/choreonoid-1.7/libCnoidOpenHRP3.1Plugin.so" Detecting plugin file "/usr/lib/choreonoid-1.7/libCnoidGRobotPlugin.so" Detecting plugin file "/usr/lib/choreonoid-1.7/libCnoidBodyPlugin.so" Detecting plugin file "/usr/lib/choreonoid-1.7/libCnoidGrxUIPlugin.so" Detecting plugin file "/usr/lib/choreonoid-1.7/libCnoidHrpsys31Plugin.so" Body-plugin has been activated. GRobot-plugin has been activated. SimulationExecutionContext has been registered. SimulationPeriodicExecutionContext has been registered. ChoreonoidExecutionContext has been registered. ChoreonoidPeriodicExecutionContext has been registered. OpenRTM-plugin has been activated. PoseSeq-plugin has been activated. Python-plugin has been activated. PythonSimScript-plugin has been activated. RobotAccess-plugin has been activated. Balancer-plugin has been activated. Corba-plugin has been activated. GrxUI-plugin has been activated. Hrpsys31-plugin has been activated. OpenHRP3.1-plugin has been activated. Loading project file "sim_mc.cnoid" ... Task sequencer '' has been deactivated. PythonPlugin: "/usr/lib/python2.7/dist-packages/hrpsys" has been added to the Python module search path list. Restoring ExtCommandItem "ModelLoader" External command "openhrp-model-loader" has been executed by item "ModelLoader". Restoring WorldItem "World" Restoring BodyItem "JVRC1" ready Loading Body "/usr/share/OpenHRP-3.1/robot/JVRC1/main.wrl" OpenGL version is 3.0. GLSL version is 1.30. illegal field event type at line 103 of /usr/share/OpenHRP-3.1/robot/JVRC1/main.wrl -> failed. Error: "JVRC1" cannot be restored. Restoring BodyItem "longfloor" Loading Body "/usr/share/OpenHRP-3.1/sample/model/longfloor.wrl" illegal vector element at line 95 of /usr/share/OpenHRP-3.1/sample/model/longfloor.wrl -> failed. Error: "longfloor" cannot be restored. Restoring AISTSimulatorItem "AISTSimulator" Restoring PythonSimScriptItem "sim_mc.py" Loading Python Script for Simulation "/usr/share/hrpsys/samples/JVRC1/sim_mc.py" -> ok! 4 / 6 item(s) have been loaded. Warning: 2 item(s) were not loaded. Project "sim_mc.cnoid" has been partially loaded. Simulation by AISTSimulator has started. Execution of Python script "sim_mc.py" has been started. [rtm.py] nshost already set as localhost [rtm.py] nsport already set as 2809 [rtm.py] Failed to parse corba.master_manager, use 2810 [rtm.py] configuration ORB with localhost:2809 [rtm.py] configuration RTCManager with localhost:2810 [rtm.py] trying to findRTCManager on port2810 The execution of Python script "sim_mc.py" failed. AttributeError: 'NoneType' object has no attribute 'port' At: /usr/share/hrpsys/samples/JVRC1/sim_mc.py(107): init /usr/share/hrpsys/samples/JVRC1/sim_mc.py(145): ```

Here are the lines causing errors:

-main.wrt (l.101-105, error stated in 103): I highly suspect the commented line 102 is causing problems here and will try to simply delete that one next

exposedField SFRotation rotation              0 0 1 0
#exposedField SFRotation orientation       0 0 1 0
exposedField SFFloat    fieldOfView       0.785398
exposedField SFString   name              ""
exposedField SFFloat    frontClipDistance 0.01
DEF WAIST Joint {
  jointType "fixed"
  translation 0.0 0.0 -0.1
  rotation 0 0 1 0
      children [
        DEF BODY Segment {

the JOINT type seems to be defined before (l.3-29) and contain both jointType and translation:

PROTO Joint [ 
    ...
    exposedField     SFRotation   rotation            0 0 1 0
    exposedField     SFVec3f      translation         0 0 0
    exposedField     SFString     jointType           ""
    ...
]
{
    Transform {
        ...
        rotation         IS rotation
        translation      IS translation
    }
}
the full files causing errors [longfloor.wrl.txt](https://github.com/jrl-umi3218/lipm_walking_controller/files/4924469/longfloor.wrl.txt) [main.wrl.txt](https://github.com/jrl-umi3218/lipm_walking_controller/files/4924470/main.wrl.txt)
arntanguy commented 4 years ago

Sorry, it seems you've been victim of the VRML loader of Choreonoid. When using a locale with coma-separated numbers, the VRML loader fails to read floating-point numbers.

You can try this:

LC_NUMERIC="en_US.UTF-8" choreonoid sim_mc.cnoid

If this works, you can either change the numeric locale to use coma-separated values, or put the above trick in your bashrc:

alias choreonoid="LC_NUMERIC=\"en_US.UTF-8\" /usr/local/bin/choreonoid"

Alternatively you could patch the VRML loader. I've been meaning to do that for ages, but haven't had the time to do it.

As a final note, bear in mind that choreonoid is not part of mc_rtc, and only provides the dynamic simulation. We are not developping it, and only try our best to make it reasonably usable with our framework ;)

elfalko commented 4 years ago

That tip was on point. I would have thought installing the system with english language and keyboard would prevent such issues, but apparently my German timezone convinced Ubuntu to make me run into this issue.

I'm aware that choreonoid is not your beast. All the more thanks for providing such great help with it (and all the other questions I had so far)!

Now all models are loading and I can see the robot in choreonoid (not in rviz though). I ran into the next issue down the line - this is from the choreonoid output:

The execution of Python script "sim_mc.py" failed.
AttributeError: 'NoneType' object has no attribute 'name'

At:
  /usr/lib/python2.7/dist-packages/hrpsys/rtm.py(550): serializeComponents
  /usr/share/hrpsys/samples/JVRC1/sim_mc.py(85): activateComps
  /usr/share/hrpsys/samples/JVRC1/sim_mc.py(119): init
  /usr/share/hrpsys/samples/JVRC1/sim_mc.py(145): <module>
arntanguy commented 4 years ago

The python script is responsible for creating the openrtm components for controlling the robot simulation (PDController for PD control of the joints, MCControlComp (mc_openrtm) for running mc_rtc controller and communicating back and forth with the simulation. It seems that some of these components failed to load (most likely PDController). From your log trace only, it's hard to tell which one and why. That's the kind of problem that would most likely be easy to figure out in person, but a bit hard remotely ;)

Was there any additional error in the terminal? I will give it a try in a docker to see if I can reproduce the issue.

arntanguy commented 4 years ago

I just gave it a try in a clean docker of ubuntu 18.04, and didn't experience your issue. At the risk of repeating myself, did you run the ./clear-omninames.sh script before running the simulation?

I also went ahead and gave LIPMWalking a try, and compiled it from source since I assume you might want to play around with the code:

sudo apt install libmc-rtc-dev libcopra-dev
git clone --recursive https://github.com/jrl-umi3218/lipm_walking_controller.git
cd lipm_walking_controller && mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
make -j8
sudo make install

and don't forget to all /usr/local/lib to your LD_LIBRARY_PATH.

If you haven't already, also install the , this requires having the ROS repositories set-up (this is not required, but will provide the rviz visualization and tools).

sudo apt install ros-melodic-desktop ros-melodic-mc-rtc-tools

Then in your ~/.config/mc_rtc/mc_rtc.yaml file:

MainRobot: JVRC1
Enabled: LIPMWalking

To run the controller:

  1. Start a roscore
    (roscore &) # starts roscore in the background
  2. Run the simulation
    cd /usr/share/hrpsys/samples/JVRC1
    ./clear-omninames.sh
    choreonoid sim_mc.cnoid --start-simulation
  3. Run rviz display (and mc_rtc GUI)
    roslaunch mc_rtc_ticker control_display.launch
  4. Go to the "Walking" tab in the gui, click on "Start Standing", then "Start Walking"
  5. You should now see the robot walk in both choreonoid and rviz.

[edit: fixed] Right now there is a slight issue with the copra package due to changes in eigen-qld. This should be fixed in a few hours ;)

elfalko commented 4 years ago

Sorry for the long silence, other things got in the way.

I have since managed to run the Walking Controller in the prepared docker image on a different PC (which did not work on this one due to GPU driver issues), which was enough for my purposes, as it sufficed to check it out to know it was not directly helpful to achieve my current project goal.

From my notes and run scripts, I can give you the following details regarding your questions:

As I'm no longer actively pursuing this, and have since broken the installation this issue occurred on in other ways and reinstalled it, I would consider this issue closed. Thank you for your great advice, it got me quite a bit further!