ADVRHumanoids/xbot2_examples

xbot2 server not found

Closed this issue · 3 comments

I am trying to run xbot2-core (no docker this time)

It prints its verbose stuff nicely:

tori@turing:~/xbot_2/src/xbot2_examples$ xbot2-core --verbose
[info][xbot2-core] parameter '/xbot_internal/hal/robot_ifc_cfg' with type 'XBot::ConfigOptions' was created 
[info][xbot2-core] parameter '/robot_description' with type 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >' was created 
[info][xbot2-core] parameter '/xbot_internal/ros_io/call_timeout' with type 'std::chrono::duration<long, std::ratio<1l, 1000000000l> >' was created 
[info][xbot2-core] parameter '/joint_master/tx_filter_autostart' with type 'bool' was created 
[info][xbot2-core] parameter '/joint_master/tx_filter_cutoff' with type 'double' was created 
[info][xbot2-core] parameter '/rt_slow/memory_hooks' with type 'bool' was created 
[info][xbot2-core] parameter '/xbot_internal/hardware_description' with type 'XBot::Hal::HardwareDescription' was created 
[info][xbot2-core] parameter '/xbot2_thread_list' with type 'std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >' was created 
[info][nrt_main] 'nrt_main': initializing xbotcore thread with period = 0.005s, scheduler = 'SCHED_OTHER', priority = 0 
[info][nrt_main] 'nrt_main': loading HalManager with devices: [] 
[info][nrt_main] 'nrt_main': loading runnable with type 'ros_io', name 'ros_io', namespace '' 
[success] RobotInterface so library found! 
[success] MODEL INTERFACE so library found! 
[info] Floating base model: FALSE
[info] Joint name: joint1 RBDL ID: 0
[info] Joint name: joint2 RBDL ID: 1
[info] Joint name: joint3 RBDL ID: 2
[info] Joint name: joint4 RBDL ID: 3
[info] Joint name: joint5 RBDL ID: 4
[success] ModelInterfaceRBDL initialized successfully!
[info] Model ordered chains: 
arm

[info][nrt_main] parameter '/xbot_internal/ros_init_token' with type 'XBot::RosIO::ros_init_token' was created 
[info][nrt_main] parameter '/ros_support/topic_callback_queue_xbot2' with type 'std::shared_ptr<XBot::CallbackQueue>' was created 
[info][nrt_main] parameter '/ros_support/topic_callback_queue_ros' with type 'std::shared_ptr<ros::CallbackQueue>' was created 
[info][nrt_main] 'nrt_main': loading runnable with type 'client', name 'client_example', namespace '' 
[success] RobotInterface so library found! 
[success] MODEL INTERFACE so library found! 
[info] Floating base model: FALSE
[info] Joint name: joint1 RBDL ID: 0
[info] Joint name: joint2 RBDL ID: 1
[info] Joint name: joint3 RBDL ID: 2
[info] Joint name: joint4 RBDL ID: 3
[info] Joint name: joint5 RBDL ID: 4
[success] ModelInterfaceRBDL initialized successfully!
[info] Model ordered chains: 
arm

But suddendly, when i run roscore on another terminal, bad things happen:

[info][nrt_main] parameter '/xbot_internal/nrt_main/task_list' with type 'std::vector<XBot::TaskDescription, std::allocator<XBot::TaskDescription> >' was created 
[warn][rt_main] 'rt_main' sched policy could not be set to SCHED_FIFO, prio = 60: real-time support not enabled 
[info][rt_main] 'rt_main': initializing xbotcore thread with period = 0.001s, scheduler = 'SCHED_OTHER', priority = 0 
[err ][joint_gz] unable to reach XBot2 server: check that the robot is up and running 
terminate called after throwing an instance of 'XBot::ConnectionError'
  what():  Unable to open shared memory file '/xbot2_state_srv_to_cli_joint_gz': No such file or directory
Annullato (core dump creato)

Could it be a problem with relative/absolute path, like for #3 ? Because I am not with the superbuild and I have xbot2 in a folder and xbotinterface and other libs stuff in /opt/xbot/... ?

[err ][joint_gz] unable to reach XBot2 server: check that the robot is up and running means gazebo (or the real robot) is not running!
Try gazebo world/teleop_xbot2.world from the repo main folder.

I had gazebo running,

The problem was that before running it I had not source /opt/xbot/setup.sh . This was expected right?

Right. Running gazebo --verbose will highlight that the gazebo-xbot2 plugin cannot be found, hence the error.