Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hrpiob] Upgrade for hrpsys 315.4.0 onward. #481

Open
wants to merge 4 commits into
base: indigo-devel
Choose a base branch
from

Conversation

130s
Copy link
Contributor

@130s 130s commented Dec 12, 2016


Since hrpsys 315.4.0 with updated RobotHardware, rtcd on QNX fails on NEXTAGE Open as follows. hrpiob with this PR hopefully fixes the issue.

Please review @534o @emijah

$ more /opt/jsk/var/log/rtcd.log 
Logger::Logger: streambuf address = 0x805fc70
hrpExecutionContext is registered
unknown symbol: number_of_thermometers
unknown symbol: number_of_batteries
unknown symbol: read_battery
Load failed.
:
Load failed.
unknown symbol: number_of_thermometers
unknown symbol: number_of_batteries
unknown symbol: read_battery
Load failed.
:
Load failed.
hrpExecutionContext is registered
Load failed.
Load failed.
Load failed.
sh: rtcprof_python: cannot execute - No such file or directory
Abort (core dumped)

@130s 130s force-pushed the hrpiob/upgrade_to_hrpsys315.4.0_onward branch from a7cccfa to be738c3 Compare December 12, 2016 20:50
@130s
Copy link
Contributor Author

130s commented Dec 12, 2016

Relevant PR fkanehiro/hrpsys-base#598

@534o
Copy link

534o commented Dec 13, 2016

better to have backward compatibility

@130s
Copy link
Contributor Author

130s commented Dec 16, 2016

better to have backward compatibility

確認ですが,次のように理解しています.

  • "backward compatibility" は hrpsys の古いバージョンのこと.
  • hrpsys が hrpiob に依存する (つまり hrpiob が上流).

上記の理解で正しいとすると,バージョン互換性を保つためのコードを加えるべきは,正論としては下流の hrpsys と思っています.
よくわかっていませんが,両者は密接な関係がある等の理由で,正論通りにはいかず,hrpiob 側に互換コードを入れるのがこの場合正しい,という状況でしょうか?

@k-okada
Copy link
Member

k-okada commented Dec 17, 2016 via email

@130s 130s force-pushed the hrpiob/upgrade_to_hrpsys315.4.0_onward branch 3 times, most recently from 15275ba to 372c9e1 Compare December 19, 2016 22:46
@130s
Copy link
Contributor Author

130s commented Dec 19, 2016

Thank you very much for the deep insight and a patch. Commits are now updated, and I'll test the .so with this change on the real robot.

$ nm -gC libhrpIo.so | grep number      
00001d40 T number_of_batteries()
00001d60 T number_of_thermometers()
00001580 T number_of_accelerometers
000015a0 T number_of_attitude_sensors
00001540 T number_of_force_sensors
00001560 T number_of_gyro_sensors
00001520 T number_of_joints
00001b80 T number_of_substeps
00001590 T set_number_of_accelerometers
00001550 T set_number_of_force_sensors
00001570 T set_number_of_gyro_sensors
00001530 T set_number_of_joints
  • .
    • After:
$ nm -gC libhrpIo.so | grep number 
00001d40 T number_of_batteries()
00001d60 T number_of_thermometers()
00001580 T number_of_accelerometers
000015a0 T number_of_attitude_sensors
00001540 T number_of_force_sensors
00001560 T number_of_gyro_sensors
00001520 T number_of_joints
00001b80 T number_of_substeps
00001590 T set_number_of_accelerometers
00001550 T set_number_of_force_sensors
00001570 T set_number_of_gyro_sensors
00001530 T set_number_of_joints

@130s
Copy link
Contributor Author

130s commented Dec 21, 2016

Trying the binary libhrpIo.so I created using the latest code in this PR but I still get exactly the same error unknown symbol, and rtcd exits.

$ more /opt/jsk/var/log/rtcd.log 
Logger::Logger: streambuf address = 0x805fc70
hrpExecutionContext is registered
unknown symbol: number_of_thermometers
unknown symbol: number_of_batteries
unknown symbol: read_battery
Load failed.
Load failed.
Load failed.
Load failed.
Load failed.
Load failed.
Load failed.
Load failed.
Load failed.
Load failed.
Load failed.
Load failed.
Load failed.
unknown symbol: number_of_thermometers
unknown symbol: number_of_batteries
unknown symbol: read_battery
Load failed.
Load failed.
Load failed.
Load failed.
Load failed.
hrpExecutionContext is registered
Load failed.
Load failed.
Load failed.
sh: rtcprof_python: cannot execute - No such file or directory
Abort (core dumped) 
$ ls -l rtcd.log 
lrwxrwxrwx  1 root      root             40 Dec 22 06:09 rtcd.log -> /opt/jsk/var/log/rtcd-20161222060900.log
$ date
Thu Dec 22 06:09:08 UTC 2016
$ ls -l /opt/nextage-open/lib/
total 511
lrwxrwxrwx  1 root      root             18 Jul 17  2014 libNxOpenCore.so -> libNxOpenCore.so.1
lrwxrwxrwx  1 root      root             22 Jul 17  2014 libNxOpenCore.so.1 -> libNxOpenCore.so.1.1.0
-rwxr-xr-x  1 root      root         219357 Jul 16  2014 libNxOpenCore.so.1.1.0
lrwxrwxrwx  1 tork      users            44 Dec 22 06:01 libhrpIo.so -> libhrpIo.so.builtwith-hrpsys315.9.0_20161219
-rwxr-xr-x  1 root      root          19488 Jul 16  2014 libhrpIo.so.20140716
-rw-r--r--  1 tork      users         20448 Dec 22 06:00 libhrpIo.so.builtwith-hrpsys315.9.0_20161219

@130s
Copy link
Contributor Author

130s commented Dec 21, 2016

Not sure if this is related, but in ModelLoader.log I see only one line (while I expect all joints name printed or something verbose when it went well).

I assume the unknown symbol error in rtcd.log and this ModelLoader.log with little output are the 2 different issues, but I appreciate if someone can confirm.

$ more /opt/jsk/var/log/ModelLoader.log 
ready
$ more /opt/jsk/var/log/rtcd.log         
Logger::Logger: streambuf address = 0x805fc70
hrpExecutionContext is registered
unknown symbol: number_of_thermometers
unknown symbol: number_of_batteries
unknown symbol: read_battery
Load failed.
Load failed.
Load failed.
Load failed.
Load failed.
Load failed.
Load failed.
Load failed.
Load failed.
Load failed.
Load failed.
Load failed.
Load failed.
unknown symbol: number_of_thermometers
unknown symbol: number_of_batteries
unknown symbol: read_battery
Load failed.
Load failed.
Load failed.
Load failed.
$ more /opt/jsk/var/log/NameServer.log 

Thu Dec 22 06:43:24 2016:

Starting omniNames for the first time.
Wrote initial log file.
Read log file successfully.
Root context is IOR:010000002b00000049444c3a6f6d672e6f72672f436f734e616d696e672f4e616d696e67436f6e746578744578743a312e300000010000000000000074000000010102000f
0000003139322e3136382e3132382e313000009d3a00000b0000004e616d6553657276696365000300000000000000080000000100000000545441010000001c000000010000000100010001000000
0100010509010100010000000901010003545441080000000c765b580100f01c
Checkpointing Phase 1: Prepare.
Checkpointing Phase 2: Commit.
Checkpointing completed.
$ more /opt/jsk/bin/rtcd.sh
#!/bin/sh

export JSK_DIR=/opt/jsk
export LOG_DIR=/opt/jsk/var/log
export PATH=$JSK_DIR/bin:$PATH
export LD_LIBRARY_PATH=/opt/nextage-open/lib:/opt/jsk/lib:$LD_LIBRARY_PATH ## use libhrpIo.so in /opt/nextage-open/lib
#export LD_LIBRARY_PATH=$JSK_DIR/share/nextage-open/lib:$JSK_DIR/lib:$LD_LIBRARY_PATH ## use libhrpIo.so in /opt/jsk/share/nextage-open
export RTCD_KILLNAME=rtcd

OS=`uname`
if [ "$OS" = "Linux" ]; then
  KILLALL="/usr/bin/killall -q"
elif [ "$OS" = "QNX" ]; then
  # On QNX many libraries requreid for hiro-nxo are installed via pkgsrc, which goes into /usr/pkg.
  export LD_LIBRARY_PATH=/usr/pkg/lib:$LD_LIBRARY_PATH
  KILLALL=/bin/slay
fi

#
# loop for rtcd
#
mkdir -p $LOG_DIR
$KILLALL -9 $RTCD_KILLNAME

while :; do
    /opt/nextage-open/bin/unlock_iob

    if [ -f $LOG_DIR/rtcd.log ]; then
        rm $LOG_DIR/rtcd.log
    fi

    DATESTRING=`date +%Y%m%d%H%M%S`
    ln -s $LOG_DIR/rtcd-$DATESTRING.log $LOG_DIR/rtcd.log
    rtcd -f /opt/jsk/etc/HIRONX/hrprtc/rtcdRobotMode.conf > $LOG_DIR/rtcd-$DATESTRING.log 2>&1

    /usr/bin/env sleep 1
    $KILLALL -9 $RTCD_KILLNAME
    /usr/bin/env sleep 1
    $KILLALL -9 $RTCD_KILLNAME
done
$ ls -l /opt/nextage-open/include/
total 6
-rw-r--r--  1 root      root           2762 Jul 16  2014 nextage-open.hpp
$ ls -l /opt/nextage-open/lib/     
total 511
lrwxrwxrwx  1 root      root             18 Jul 17  2014 libNxOpenCore.so -> libNxOpenCore.so.1
lrwxrwxrwx  1 root      root             22 Jul 17  2014 libNxOpenCore.so.1 -> libNxOpenCore.so.1.1.0
-rwxr-xr-x  1 root      root         219357 Jul 16  2014 libNxOpenCore.so.1.1.0
lrwxrwxrwx  1 tork      users            44 Dec 22 06:01 libhrpIo.so -> libhrpIo.so.builtwith-hrpsys315.9.0_20161219
-rwxr-xr-x  1 root      root          19488 Jul 16  2014 libhrpIo.so.20140716
-rw-r--r--  1 tork      users         20448 Dec 22 06:00 libhrpIo.so.builtwith-hrpsys315.9.0_20161219

@130s
Copy link
Contributor Author

130s commented Dec 21, 2016

Not sure if this is related, but in ModelLoader.log I see only one line (while I expect all joints name printed or something verbose when it went well).

I assume the unknown symbol error in rtcd.log and this ModelLoader.log with little output are the 2 different issues, but I appreciate if someone can confirm.

Looking at older ModelLoader log files, the less output started exactly when hrpsys was updated to 315.9.0.

Now I also switched to hrpsys 315.7.0 but the symptom in both ModelLoader.log and rtcd.log remain the same..

@130s
Copy link
Contributor Author

130s commented Dec 21, 2016

sh: rtcprof_python: cannot execute - No such file or directory

Looks like this is also something that started with newer hrpsys (as you see below no rtcd-* from last month where the controller was still 315.1.8 has it).

$ grep -r rtcprof_python /opt/jsk/var/log/rtcd-201611*
$

@130s
Copy link
Contributor Author

130s commented Dec 21, 2016

#481 (comment)

sh: rtcprof_python: cannot execute - No such file or directory

Looks like this is also something that started with newer hrpsys

I found an old ticket start-jsk/rtmros_common#294 (comment) where I see the same rtcprof_python error as above along with unknown symbol, and that was solved by placing the right library. So I think we don't need to worry about rtcprof_python error.

@130s
Copy link
Contributor Author

130s commented Dec 22, 2016

Switched back to hrpsys 315.1.8, one good news is that with the updated libhrpIo.so, it seems to have successfully launched. So the code in this PR is hrpsys-backward compatible so far (haven't tested running client commands yet).

$ ls -l /opt/jsk/
total 14
drwxrwxr-x  6 tork      users          1024 Dec 08 07:37 315.1.8
drwxrwxr-x  6 tork      users          1024 Dec 22 08:25 315.7.0
drwxrwxr-x  6 tork      users          1024 Dec 08 07:38 315.9.0
lrwxrwxrwx  1 tork      users            11 Dec 22 08:49 bin -> 315.1.8/bin
drwxr-xr-x  3 tork      users          1024 Jul 10  2014 etc
lrwxrwxrwx  1 tork      users            15 Dec 22 08:49 include -> 315.1.8/include
lrwxrwxrwx  1 tork      users            11 Dec 22 08:49 lib -> 315.1.8/lib
lrwxrwxrwx  1 tork      users            13 Dec 22 08:49 share -> 315.1.8/share
drwxrwxr-x  3 tork      users          1024 Jul 10  2014 var
$ more /opt/jsk/var/log/ModelLoader.log 
ready
loading /opt/jsk/etc/HIRONX/model/main.wrl
Humanoid node
Joint nodeWAIST
  Segment node WAIST_Link
  Joint nodeCHEST_JOINT0
    Segment node CHEST_JOINT0_Link
    Joint nodeHEAD_JOINT0
      Segment node HEAD_JOINT0_Link
      Joint nodeHEAD_JOINT1
        Segment node HEAD_JOINT1_Link
        VisionSensorCAMERA_HEAD_R
        VisionSensorCAMERA_HEAD_L
    Joint nodeRARM_JOINT0
      Segment node RARM_JOINT0_Link
      Joint nodeRARM_JOINT1
        Segment node RARM_JOINT1_Link
        Joint nodeRARM_JOINT2
          Segment node RARM_JOINT2_Link
          Joint nodeRARM_JOINT3
            Segment node RARM_JOINT3_Link
            Joint nodeRARM_JOINT4
              Segment node RARM_JOINT4_Link
              Joint nodeRARM_JOINT5
                Segment node RARM_JOINT5_Link
    Joint nodeLARM_JOINT0
      Segment node LARM_JOINT0_Link
      Joint nodeLARM_JOINT1
        Segment node LARM_JOINT1_Link
        Joint nodeLARM_JOINT2
          Segment node LARM_JOINT2_Link
          Joint nodeLARM_JOINT3
            Segment node LARM_JOINT3_Link
            Joint nodeLARM_JOINT4
              Segment node LARM_JOINT4_Link
              Joint nodeLARM_JOINT5
                Segment node LARM_JOINT5_Link
Node is inconvertible and removed from the scene graph
Node is inconvertible and removed from the scene graph
Warning: Mass is zero. <Model>HiroNX <Link>CHEST_JOINT0
Warning: Mass is zero. <Model>HiroNX <Link>WAIST
The model was successfully loaded ! 
$ more /opt/jsk/var/log/rtcd.log         
hrpExecutionContext is registered
pdgains.file_name: /opt/jsk/etc/HIRONX/hrprtc/PDgains.sav
dof = 15
open_iob - NEXTAGE OPEN  I/F v1 instance at 0x80b1f28
-- NEXTAGE::OpenV10::open_iob()
-- NEXTAGE::OpenV10::open_iob - at 0x80aff90

-- NEXTAGE::OpenV10::open_iob(): succeeded, lockower is -1
the number of gyros = 0
the number of accelerometers = 0
the number of force sensors = 0
open_iob - NEXTAGE OPEN I/F instance is not NULL, ignored
-- NEXTAGE::OpenV10::lock_iob()
ShMIF::lock()
ShmIF::lock(): IOB_OK owner: 784396320, self: 784396320
period = 5[ms], priority = 49
$ ls -l /opt/nextage-open/lib/
total 511
lrwxrwxrwx  1 root      root             18 Jul 17  2014 libNxOpenCore.so -> libNxOpenCore.so.1
lrwxrwxrwx  1 root      root             22 Jul 17  2014 libNxOpenCore.so.1 -> libNxOpenCore.so.1.1.0
-rwxr-xr-x  1 root      root         219357 Jul 16  2014 libNxOpenCore.so.1.1.0
lrwxrwxrwx  1 tork      users            44 Dec 22 06:01 libhrpIo.so -> libhrpIo.so.builtwith-hrpsys315.9.0_20161219
-rwxr-xr-x  1 root      root          19488 Jul 16  2014 libhrpIo.so.20140716
-rw-r--r--  1 tork      users         20448 Dec 22 06:00 libhrpIo.so.builtwith-hrpsys315.9.0_20161219

@130s 130s force-pushed the hrpiob/upgrade_to_hrpsys315.4.0_onward branch from 372c9e1 to 92baa5e Compare January 11, 2017 20:08
@130s
Copy link
Contributor Author

130s commented Jan 11, 2017

I've added a couple of commits, and now I'm able to build with build-default.sh script that comes within hrpiob folder.

I noticed, however, that cmake failed to find hrpsys-base by pkg-config on my QNX I'm using. I have to look into this but will appreciate if anyone has some immdiate clues.

$ ./build-default.sh
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/qnx650/host/qnx6/x86/usr/bin/gcc
-- Check for working C compiler: /usr/qnx650/host/qnx6/x86/usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/qnx650/host/qnx6/x86/usr/bin/c++
-- Check for working CXX compiler: /usr/qnx650/host/qnx6/x86/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
Package hrpsys-base was not found in the pkg-config search path.
Perhaps you should add the directory containing `hrpsys-base.pc'
to the PKG_CONFIG_PATH environment variable
No package 'hrpsys-base' found
Package hrpsys-base was not found in the pkg-config search path.
Perhaps you should add the directory containing `hrpsys-base.pc'
to the PKG_CONFIG_PATH environment variable
No package 'hrpsys-base' found
HRPSYSBASE_CXX_FLAGS:
HRPSYSBASE_VERSION:
-- Configuring done
-- Generating done
-- Build files have been written to: /home/tork/nxo/hrpiob/src_hrpiob/_build
/usr/pkg/bin/cmake -H/home/tork/nxo/hrpiob/src_hrpiob -B/home/tork/nxo/hrpiob/src_hrpiob/_build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/pkg/bin/cmake -E cmake_progress_start /home/tork/nxo/hrpiob/src_hrpiob/_build/CMakeFiles /home/tork/nxo/hrpiob/src_hrpiob/_build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory `/home/tork/nxo/hrpiob/src_hrpiob/_build'
make -f CMakeFiles/hrpIo.dir/build.make CMakeFiles/hrpIo.dir/depend
make[2]: Entering directory `/home/tork/nxo/hrpiob/src_hrpiob/_build'
cd /home/tork/nxo/hrpiob/src_hrpiob/_build && /usr/pkg/bin/cmake -E cmake_depends "Unix Makefiles" /home/tork/nxo/hrpiob/src_hrpiob /home/tork/nxo/hrpiob/src_hrpiob /home/tork/nxo/hrpiob/src_hrpiob/_build /home/tork/nxo/hrpiob/src_hrpiob/_build /home/tork/nxo/hrpiob/src_hrpiob/_build/CMakeFiles/hrpIo.dir/DependInfo.cmake --color=
Dependee "/home/tork/nxo/hrpiob/src_hrpiob/_build/CMakeFiles/hrpIo.dir/DependInfo.cmake" is newer than depender "/home/tork/nxo/hrpiob/src_hrpiob/_build/CMakeFiles/hrpIo.dir/depend.internal".
Dependee "/home/tork/nxo/hrpiob/src_hrpiob/_build/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/home/tork/nxo/hrpiob/src_hrpiob/_build/CMakeFiles/hrpIo.dir/depend.internal".
Scanning dependencies of target hrpIo
make[2]: Leaving directory `/home/tork/nxo/hrpiob/src_hrpiob/_build'
make -f CMakeFiles/hrpIo.dir/build.make CMakeFiles/hrpIo.dir/build
make[2]: Entering directory `/home/tork/nxo/hrpiob/src_hrpiob/_build'
/usr/pkg/bin/cmake -E cmake_progress_report /home/tork/nxo/hrpiob/src_hrpiob/_build/CMakeFiles 1
[100%] Building CXX object CMakeFiles/hrpIo.dir/iob.cpp.o
QCC  -x c++ -DhrpIo_EXPORTS -V4.4.2,gcc_ntox86_cpp -Wall -O3 -DNDEBUG -I/home/tork/nxo/hrpiob/src_hrpiob -I/opt/jsk/include -I/usr/pkg/include   -o CMakeFiles/hrpIo.dir/iob.cpp.o -c /home/tork/nxo/hrpiob/src_hrpiob/iob.cpp
/home/tork/nxo/hrpiob/src_hrpiob/iob.cpp:737:16: warning: extra tokens at end of #ifndef directive
Linking CXX shared library libhrpIo.so
/usr/pkg/bin/cmake -E cmake_link_script CMakeFiles/hrpIo.dir/link.txt --verbose=1
QCC   -V4.4.2,gcc_ntox86_cpp -Wall -O3 -DNDEBUG  -shared -Wl,-soname,libhrpIo.so -o libhrpIo.so CMakeFiles/hrpIo.dir/iob.cpp.o -L/home/tork/nxo/hrpiob/src_hrpiob/_build -L/opt/jsk/lib -L/usr/pkg/lib -lboost_thread -Wl,-rpath,/home/tork/nxo/hrpiob/src_hrpiob/_build:/opt/jsk/lib:/usr/pkg/lib
make[2]: Leaving directory `/home/tork/nxo/hrpiob/src_hrpiob/_build'
/usr/pkg/bin/cmake -E cmake_progress_report /home/tork/nxo/hrpiob/src_hrpiob/_build/CMakeFiles  1
[100%] Built target hrpIo
make[1]: Leaving directory `/home/tork/nxo/hrpiob/src_hrpiob/_build'
/usr/pkg/bin/cmake -E cmake_progress_start /home/tork/nxo/hrpiob/src_hrpiob/_build/CMakeFiles 0
[100%] Built target hrpIo
Linking CXX shared library CMakeFiles/CMakeRelink.dir/libhrpIo.so
Install the project...
-- Install configuration: "Release"
-- Installing: /opt/nextage-open/lib/libhrpIo.so

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants