jrl-umi3218 / mc_openrtm

Interface between OpenRTM and mc_rtc
BSD 2-Clause "Simplified" License
3 stars 10 forks source link

Choreonoid aborted on exit #28

Closed mmurooka closed 1 year ago

mmurooka commented 1 year ago

When you start the mc_rtc controller in choreonoid and exit choreonoid (by closing the window or clicking exit from the menu bar), choreonoid is terminated with abort. This has not caused any serious problems so far, but it does seem to be causing the problem that the perf files discussed in https://github.com/choreonoid/choreonoid/issues/29#issuecomment-1422131447 are not being dumped properly.

The following is an example of Posture controller with JVRC1, where choreonoid is terminated with abort.

$ choreonoid sim_mc.cnoid 
PDcontroller0: onInitialize() 
Loading body customizer "/home/mmurooka/workspace/install/share/OpenHRP-3.1/customizer/HRP2Customizer.so" for HRP2, HRP2NF1, HRP2TIG, HRP2D, HRP2JRL, HRP2A, HRP2JSK, HRP2JSKNT, HRP2W, HRP2K, HRP2SH, HRP2DRC, HRP2JVRC, HRP2KAI, HRP3, HRP4L, HRP4, HRP4Cg, HRP4R, HRP4J
Loading body customizer "/home/mmurooka/workspace/install/share/OpenHRP-3.1/customizer/HRP5PCustomizer.so" for HRP5P
Loading body customizer "/home/mmurooka/workspace/install/share/OpenHRP-3.1/customizer/libSampleBushCustomizer.so" for 
Loading body customizer "/home/mmurooka/workspace/install/share/OpenHRP-3.1/customizer/libSampleCustomizer.so" for springJoint
Loading body customizer "/home/mmurooka/workspace/install/share/OpenHRP-3.1/customizer/HRP4CRCustomizer.so" for HRP4CR
QCursor: Cannot create bitmap cursor; invalid bitmap(s)
QCursor: Cannot create bitmap cursor; invalid bitmap(s)
PDcontroller0: on Activated 
[PDcontroller0] Gain file [PDgains_sim.dat] opened
[PDcontroller0] tlimit_ratio is set to 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
[PDcontroller0] loadGain
[PDcontroller0]   R_HIP_P, pgain = 5000, dgain = 30
[PDcontroller0]   R_HIP_R, pgain = 5000, dgain = 30
[PDcontroller0]   R_HIP_Y, pgain = 5000, dgain = 30
[PDcontroller0]   R_KNEE, pgain = 6000, dgain = 50
[PDcontroller0]   R_ANKLE_R, pgain = 3000, dgain = 20
[PDcontroller0]   R_ANKLE_P, pgain = 3000, dgain = 20
[PDcontroller0]   L_HIP_P, pgain = 5000, dgain = 30
[PDcontroller0]   L_HIP_R, pgain = 5000, dgain = 30
[PDcontroller0]   L_HIP_Y, pgain = 5000, dgain = 30
[PDcontroller0]   L_KNEE, pgain = 6000, dgain = 50
[PDcontroller0]   L_ANKLE_R, pgain = 3000, dgain = 20
[PDcontroller0]   L_ANKLE_P, pgain = 3000, dgain = 20
[PDcontroller0]   WAIST_Y, pgain = 5000, dgain = 32
[PDcontroller0]   WAIST_P, pgain = 5000, dgain = 32
[PDcontroller0]   WAIST_R, pgain = 5000, dgain = 32
[PDcontroller0]   NECK_Y, pgain = 1000, dgain = 21
[PDcontroller0]   NECK_R, pgain = 1000, dgain = 21
[PDcontroller0]   NECK_P, pgain = 1000, dgain = 21
[PDcontroller0]   R_SHOULDER_P, pgain = 1100, dgain = 70
[PDcontroller0]   R_SHOULDER_R, pgain = 1100, dgain = 70
[PDcontroller0]   R_SHOULDER_Y, pgain = 1100, dgain = 70
[PDcontroller0]   R_ELBOW_P, pgain = 1200, dgain = 80
[PDcontroller0]   R_ELBOW_Y, pgain = 1200, dgain = 80
[PDcontroller0]   R_WRIST_R, pgain = 500, dgain = 24
[PDcontroller0]   R_WRIST_Y, pgain = 500, dgain = 24
[PDcontroller0]   R_UTHUMB, pgain = 30, dgain = 3
[PDcontroller0]   R_LTHUMB, pgain = 30, dgain = 3
[PDcontroller0]   R_UINDEX, pgain = 30, dgain = 3
[PDcontroller0]   R_LINDEX, pgain = 30, dgain = 3
[PDcontroller0]   R_ULITTLE, pgain = 30, dgain = 3
[PDcontroller0]   R_LLITTLE, pgain = 30, dgain = 3
[PDcontroller0]   L_SHOULDER_P, pgain = 1100, dgain = 70
[PDcontroller0]   L_SHOULDER_R, pgain = 1100, dgain = 70
[PDcontroller0]   L_SHOULDER_Y, pgain = 1100, dgain = 70
[PDcontroller0]   L_ELBOW_P, pgain = 1200, dgain = 80
[PDcontroller0]   L_ELBOW_Y, pgain = 1200, dgain = 80
[PDcontroller0]   L_WRIST_R, pgain = 500, dgain = 24
[PDcontroller0]   L_WRIST_Y, pgain = 500, dgain = 24
[PDcontroller0]   L_UTHUMB, pgain = 30, dgain = 3
[PDcontroller0]   L_LTHUMB, pgain = 30, dgain = 3
[PDcontroller0]   L_UINDEX, pgain = 30, dgain = 3
[PDcontroller0]   L_LINDEX, pgain = 30, dgain = 3
[PDcontroller0]   L_ULITTLE, pgain = 30, dgain = 3
[PDcontroller0]   L_LLITTLE, pgain = 30, dgain = 3
[StateHolder0] onInitialize()
StateHolder: dt = 0.005
[DataLogger0] onInitialize()
[info] Loading default global configuration /home/mmurooka/workspace/install/etc/mc_rtc.yaml
[info] Loading additional global configuration /home/mmurooka/.config/mc_rtc/mc_rtc.yaml
[info] Enabled plugins: ROS (autoload)
[info] GUI server enabled
[info] Will serve data on:
[info] - ipc:///tmp/mc_rtc_pub.ipc
[info] - tcp://*:4242
[info] Will handle requests on:
[info] - ipc:///tmp/mc_rtc_rep.ipc
[info] - tcp://*:4343
[info] Loading additional plugin configuration: /home/mmurooka/workspace/install/lib/mc_plugins/etc/ROS.yaml
[error] LIPMWalking was compiled with 2.0.1 but mc_rtc is currently at version 2.1.0, you might experience subtle issues and should recompile your code
[info] Create controller Posture
[info] Robots loaded in controller:
[info] - jvrc1
[info] - ground
[info] MCController(base) ready
[info] Added task posture_jvrc1
[warning] [MC_RTC_DEPRECATED] Prefer using addContact/removeContact for contacts manipulation instead of QPSolver::setContacts
[success] MCPostureController init done
[warning] [MCController::Posture] No state observation pipeline configured: the state of the real robots will not be estimated
[info] Create controller HalfSitPose
[info] Robots loaded in controller:
[info] - jvrc1
[info] - ground
[info] MCController(base) ready
[info] Added task posture_jvrc1
[warning] [MC_RTC_DEPRECATED] Prefer using addContact/removeContact for contacts manipulation instead of QPSolver::setContacts
[success] MCHalfSitPoseController init done
[warning] [MCController::HalfSitPose] No state observation pipeline configured: the state of the real robots will not be estimated
[info] MCControl::onInitialize() starting
[info] MCControl::onInitialize() finished
KalmanFilter::onActivated(1000)
KalmanFilter: Q = 0.01, Q_bw = 0.001, R = 0.1, dt = 0.005, filter order = 0, Tgsens = 0.05
[info] onActivated
[info] Init controller
[info] Initializing attitude from robot module: q=[1.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.828]
[info] Will log controller outputs to /tmp/mc-control-Posture-2023-02-08-16-51-53.bin
[info] Updated latest log symlink: /tmp/mc-control-Posture-latest.bin
[success] [mc_rtc::ROS] Starting ROS services
PDcontroller0: on Deactivated 
terminate called after throwing an instance of 'CORBA::OBJECT_NOT_EXIST'
Aborted
$ echo $?
134
gergondet commented 1 year ago

I tracked down the issue to the OpenRTM plugin finalize() method. The PR referenced above should fix that.