BehaviorTree / Groot

Graphical Editor to create BehaviorTrees. Compliant with BehaviorTree.CPP
718 stars 237 forks source link

compling error zmq when installing #181

Open lyd00116 opened 1 year ago

lyd00116 commented 1 year ago

I met an error when compling through catkin build: /home/lyd/work/work0/groot_ws/src/Groot/bt_editor/sidepanel_monitor.cpp: In member function ‘void SidepanelMonitor::on_timer()’: /home/lyd/work/work0/groot_ws/src/Groot/bt_editor/sidepanel_monitor.cpp:44:41: error: no matching function for call to ‘zmq::socket_t::recv(zmq::message_t&)’ while( _zmq_subscriber.recv(msg) ) I also met: /home/lyd/work/work0/groot_ws/src/Groot/bt_editor/sidepanel_monitor.cpp: In member function ‘bool SidepanelMonitor::getTreeFromServer()’: /home/lyd/work/work0/groot_ws/src/Groot/bt_editor/sidepanel_monitor.cpp:133:39: error: ‘zmq::send_flags’ has not been declared zmq_client.send(request, zmq::send_flags::none); ^~~~~~~~~~ /home/lyd/work/work0/groot_ws/src/Groot/bt_editor/sidepanel_monitor.cpp:135:60: error: ‘zmq::recv_flags’ has not been declared auto bytes_received = zmq_client.recv(reply, zmq::recv_flags::none); ^~~~~~~~~~ make[2]: *** [CMakeFiles/behavior_tree_editor.dir/bt_editor/sidepanel_monitor.cpp.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [CMakeFiles/behavior_tree_editor.dir/all] Error 2 make: *** [all] Error 2 I hope someone can help me!

pverma907 commented 1 year ago

@lyd00116 I recieved the same error. The problem may be in incompatibility of zmq and groot. Try to downgrade your zmq to 4.1 version and use behaviortree.cpp v3.8.

lyd00116 commented 1 year ago

Thank you!

wisjaber commented 1 year ago

Good morning, I am facing the same exact error. using zmq 4.1 did not fix the issue. what can i do?

kundezui commented 1 year ago

I also encountered this problem, and downgraded the zmq version to 4.1, but still not solved!Is there any other solution?

/home/qwert/BehaviorTree.CPP/Groot/bt_editor/sidepanel_monitor.cpp: In member function ‘void SidepanelMonitor::on_timer()’: /home/qwert/BehaviorTree.CPP/Groot/bt_editor/sidepanel_monitor.cpp:61:41: error: no matching function for call to ‘zmq::socket_t::recv(zmq::message_t&)’ while( _zmq_subscriber.recv(msg) ) ^ In file included from /home/qw/BehaviorTree.CPP/Groot/bt_editor/sidepanel_monitor.h:5:0, from /home/qw/BehaviorTree.CPP/Groot/bt_editor/sidepanel_monitor.cpp:1: /usr/include/zmq.hpp:625:23: note: candidate: size_t zmq::socket_t::recv(void, size_t, int) inline size_t recv (void buf_, sizet len, int flags_ = 0) ^~~~ /usr/include/zmq.hpp:625:23: note: candidate expects 3 arguments, 1 provided /usr/include/zmq.hpp:635:21: note: candidate: bool zmq::socket_t::recv(zmq::message_t, int) inline bool recv (message_t msg, int flags = 0) ^~~~ /usr/include/zmq.hpp:635:21: note: no known conversion for argument 1 from ‘zmq::message_t’ to ‘zmq::message_t*’ /home/qwert/BehaviorTree.CPP/Groot/bt_editor/sidepanel_monitor.cpp: In member function ‘bool SidepanelMonitor::getTreeFromServer()’: /home/qwert/BehaviorTree.CPP/Groot/bt_editor/sidepanel_monitor.cpp:149:39: error: ‘zmq::send_flags’ has not been declared zmq_client.send(request, zmq::send_flags::none); ^~~~~~ /home/qwert/BehaviorTree.CPP/Groot/bt_editor/sidepanel_monitor.cpp:151:60: error: ‘zmq::recv_flags’ has not been declared auto bytes_received = zmq_client.recv(reply, zmq::recv_flags::none); ^~~~~~ CMakeFiles/behavior_tree_editor.dir/build.make:382: recipe for target 'CMakeFiles/behavior_tree_editor.dir/bt_editor/sidepanel_monitor.cpp.o' failed make[2]: [CMakeFiles/behavior_tree_editor.dir/bt_editor/sidepanel_monitor.cpp.o] Error 1 CMakeFiles/Makefile2:109: recipe for target 'CMakeFiles/behavior_tree_editor.dir/all' failed make[1]: [CMakeFiles/behavior_tree_editor.dir/all] Error 2 Makefile:129: recipe for target 'all' failed make: *** [all] Error 2

lyd00116 commented 1 year ago

@kundezui @wisesama see https://github.com/BehaviorTree/Groot/pull/172 https://github.com/BehaviorTree/Groot/pull/172/commits/a0db79aeb6bdf9deeeddea95c64e8c7b93526f02 I finally fix this problem with them.

lyd00116 commented 1 year ago

https://github.com/BehaviorTree/Groot/issues/171

wisjaber commented 1 year ago

@lyd00116 can you maybe share what you did for it to work? because I certainly am still getting the same errors. And the issue you mentioned doesn't go over the same error? or am i missing something? for context I am using ROS1 with BTCPP v3.8

/home/wissam/work/src/Groot/bt_editor/sidepanel_monitor.cpp: In member function ‘void SidepanelMonitor::on_timer()’: /home/wissam/work/src/Groot/bt_editor/sidepanel_monitor.cpp:61:41: error: no matching function for call to ‘zmq::socket_t::recv(zmq::message_t&)’ while( _zmq_subscriber.recv(msg) ) ^ In file included from /home/wissam/work/src/Groot/bt_editor/sidepanel_monitor.h:5:0, from /home/wissam/work/src/Groot/bt_editor/sidepanel_monitor.cpp:1: /usr/include/zmq.hpp:625:23: note: candidate: size_t zmq::socket_t::recv(void, size_t, int) inline size_t recv (void buf_, sizet len, int flags_ = 0) ^~~~ /usr/include/zmq.hpp:625:23: note: candidate expects 3 arguments, 1 provided /usr/include/zmq.hpp:635:21: note: candidate: bool zmq::socket_t::recv(zmq::message_t, int) inline bool recv (message_t msg, int flags = 0) ^~~~ /usr/include/zmq.hpp:635:21: note: no known conversion for argument 1 from ‘zmq::message_t’ to ‘zmq::message_t*’ /home/wissam/work/src/Groot/bt_editor/sidepanel_monitor.cpp: In member function ‘bool SidepanelMonitor::getTreeFromServer()’: /home/wissam/work/src/Groot/bt_editor/sidepanel_monitor.cpp:149:39: error: ‘zmq::send_flags’ has not been declared zmq_client.send(request, zmq::send_flags::none); ^~~~~~ /home/wissam/work/src/Groot/bt_editor/sidepanel_monitor.cpp:151:60: error: ‘zmq::recv_flags’ has not been declared auto bytes_received = zmq_client.recv(reply, zmq::recv_flags::none); ^~~~~~ CMakeFiles/behavior_tree_editor.dir/build.make:382: recipe for target 'CMakeFiles/behavior_tree_editor.dir/bt_editor/sidepanel_monitor.cpp.o' failed make[2]: [CMakeFiles/behavior_tree_editor.dir/bt_editor/sidepanel_monitor.cpp.o] Error 1 CMakeFiles/Makefile2:107: recipe for target 'CMakeFiles/behavior_tree_editor.dir/all' failed make[1]: [CMakeFiles/behavior_tree_editor.dir/all] Error 2 Makefile:140: recipe for target 'all' failed make: *** [all] Error 2

lyd00116 commented 1 year ago

@wisesama Sorry,I can only recover some steps about solving this problem.You can try downloading the older edition instead the master of groot.And then may ecounter some problem with c++11....................(I don't remember the exact error).Then you can modify the code inside according #172 If it works,please tell me,thank you!

lyd00116 commented 1 year ago

image

kundezui commented 1 year ago

@kundezui @wisesama 参见#172 a0db79a 我终于和他们一起解决了这个问题。

The solution you pointed out doesn't seem to fit my error.

lyd00116 commented 1 year ago

try https://github.com/BehaviorTree/Groot/issues/181#issuecomment-1461925530

wisjaber commented 1 year ago

@lyd00116 Can't thank you enough, I used revert-157-Fix_Build branch and changed the CMakeList.txt file from the submit you mentioned and it worked! thanks again

RitikJain12 commented 1 year ago

172 fixed these issues but, downgrading to zmq 4.1 - https://github.com/zeromq/zeromq4-1.git gave me the following error using zmq 4.3.4 didn't throw these errors but for some reason, the TCP server never connects to GROOT for real-time monitoring

In file included from /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_monitor.h:5, from /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_monitor.cpp:1: /usr/include/zmq.hpp:638:14: error: ‘ZMQ_BLOCKY’ was not declared in this scope; did you mean ‘ZMQ_NOBLOCK’? 638 | blocky = ZMQ_BLOCKY, | ^~~~~~ | ZMQ_NOBLOCK /usr/include/zmq.hpp:642:31: error: ‘ZMQ_THREAD_AFFINITY_CPU_ADD’ was not declared in this scope 642 | thread_affinity_cpu_add = ZMQ_THREAD_AFFINITY_CPU_ADD, | ^~~~~~~ /usr/include/zmq.hpp:643:34: error: ‘ZMQ_THREAD_AFFINITY_CPU_REMOVE’ was not declared in this scope 643 | thread_affinity_cpu_remove = ZMQ_THREAD_AFFINITY_CPU_REMOVE, | ^~~~~~~~~~ /usr/include/zmq.hpp:644:26: error: ‘ZMQ_THREAD_NAME_PREFIX’ was not declared in this scope 644 | thread_name_prefix = ZMQ_THREAD_NAME_PREFIX, | ^~~~~~ /usr/include/zmq.hpp:645:17: error: ‘ZMQ_MAX_MSGSZ’ was not declared in this scope; did you mean ‘ZMQ_MAXMSGSIZE’? 645 | max_msgsz = ZMQ_MAX_MSGSZ, | ^~~~~ | ZMQ_MAXMSGSIZE /usr/include/zmq.hpp:652:18: error: ‘ZMQ_MSG_T_SIZE’ was not declared in this scope 652 | msg_t_size = ZMQ_MSG_T_SIZE | ^~~~~~ In file included from /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_monitor.h:5, from /home/ritik/ilrepo/src/Groot/bt_editor/mainwindow.h:22, from /home/ritik/ilrepo/src/Groot/bt_editor/mainwindow.cpp:1: /usr/include/zmq.hpp:638:14: error: ‘ZMQ_BLOCKY’ was not declared in this scope; did you mean ‘ZMQ_NOBLOCK’? 638 | blocky = ZMQ_BLOCKY, | ^~~~~~ | ZMQ_NOBLOCK /usr/include/zmq.hpp:642:31: error: ‘ZMQ_THREAD_AFFINITY_CPU_ADD’ was not declared in this scope 642 | thread_affinity_cpu_add = ZMQ_THREAD_AFFINITY_CPU_ADD, | ^~~~~~~ /usr/include/zmq.hpp:643:34: error: ‘ZMQ_THREAD_AFFINITY_CPU_REMOVE’ was not declared in this scope 643 | thread_affinity_cpu_remove = ZMQ_THREAD_AFFINITY_CPU_REMOVE, | ^~~~~~~~~~ In file included from /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_monitor.h:5, from /home/ritik/ilrepo/src/Groot/bt_editor/mainwindow.h:22, from /home/ritik/ilrepo/src/Groot/bt_editor/graphic_container.cpp:3: /usr/include/zmq.hpp:638:14: error: ‘ZMQ_BLOCKY’ was not declared in this scope; did you mean ‘ZMQ_NOBLOCK’? 638 | blocky = ZMQ_BLOCKY, | ^~~~~~ | ZMQ_NOBLOCK /usr/include/zmq.hpp:644:26: error: ‘ZMQ_THREAD_NAME_PREFIX’ was not declared in this scope 644 | thread_name_prefix = ZMQ_THREAD_NAME_PREFIX, | ^~~~~~ /usr/include/zmq.hpp:642:31: error: ‘ZMQ_THREAD_AFFINITY_CPU_ADD’ was not declared in this scope 642 | thread_affinity_cpu_add = ZMQ_THREAD_AFFINITY_CPU_ADD, | ^~~~~~~ /usr/include/zmq.hpp:645:17: error: ‘ZMQ_MAX_MSGSZ’ was not declared in this scope; did you mean ‘ZMQ_MAXMSGSIZE’? 645 | max_msgsz = ZMQ_MAX_MSGSZ, | ^~~~~ | ZMQ_MAXMSGSIZE /usr/include/zmq.hpp:643:34: error: ‘ZMQ_THREAD_AFFINITY_CPU_REMOVE’ was not declared in this scope 643 | thread_affinity_cpu_remove = ZMQ_THREAD_AFFINITY_CPU_REMOVE, | ^~~~~~~~~~ /usr/include/zmq.hpp:652:18: error: ‘ZMQ_MSG_T_SIZE’ was not declared in this scope 652 | msg_t_size = ZMQ_MSG_T_SIZE | ^~~~~~ /usr/include/zmq.hpp:644:26: error: ‘ZMQ_THREAD_NAME_PREFIX’ was not declared in this scope 644 | thread_name_prefix = ZMQ_THREAD_NAME_PREFIX, | ^~~~~~ /usr/include/zmq.hpp:645:17: error: ‘ZMQ_MAX_MSGSZ’ was not declared in this scope; did you mean ‘ZMQ_MAXMSGSIZE’? 645 | max_msgsz = ZMQ_MAX_MSGSZ, | ^~~~~ | ZMQ_MAXMSGSIZE /usr/include/zmq.hpp:652:18: error: ‘ZMQ_MSG_T_SIZE’ was not declared in this scope 652 | msg_t_size = ZMQ_MSG_T_SIZE | ^~~~~~ In file included from /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_monitor.h:5, from /home/ritik/ilrepo/src/Groot/bt_editor/mainwindow.h:22, from /home/ritik/ilrepo/build/Groot/behavior_tree_editor_autogen/EFDBK3ICJA/moc_mainwindow.cpp:9, from /home/ritik/ilrepo/build/Groot/behavior_tree_editor_autogen/mocs_compilation.cpp:4: /usr/include/zmq.hpp:638:14: error: ‘ZMQ_BLOCKY’ was not declared in this scope; did you mean ‘ZMQ_NOBLOCK’? 638 | blocky = ZMQ_BLOCKY, | ^~~~~~ | ZMQ_NOBLOCK /usr/include/zmq.hpp:642:31: error: ‘ZMQ_THREAD_AFFINITY_CPU_ADD’ was not declared in this scope 642 | thread_affinity_cpu_add = ZMQ_THREAD_AFFINITY_CPU_ADD, | ^~~~~~~ /usr/include/zmq.hpp:643:34: error: ‘ZMQ_THREAD_AFFINITY_CPU_REMOVE’ was not declared in this scope 643 | thread_affinity_cpu_remove = ZMQ_THREAD_AFFINITY_CPU_REMOVE, | ^~~~~~~~~~ /usr/include/zmq.hpp:644:26: error: ‘ZMQ_THREAD_NAME_PREFIX’ was not declared in this scope 644 | thread_name_prefix = ZMQ_THREAD_NAME_PREFIX, | ^~~~~~ /usr/include/zmq.hpp:645:17: error: ‘ZMQ_MAX_MSGSZ’ was not declared in this scope; did you mean ‘ZMQ_MAXMSGSIZE’? 645 | max_msgsz = ZMQ_MAX_MSGSZ, | ^~~~~ | ZMQ_MAXMSGSIZE /usr/include/zmq.hpp:652:18: error: ‘ZMQ_MSG_T_SIZE’ was not declared in this scope 652 | msg_t_size = ZMQ_MSG_T_SIZE | ^~~~~~ /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_monitor.cpp: In member function ‘void SidepanelMonitor::on_timer()’: /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_monitor.cpp:44:42: warning: ‘bool zmq::detail::socket_base::recv(zmq::message_t, int)’ is deprecated: from 4.3.1, use recv taking a reference to message_t and recv_flags [-Wdeprecated-declarations] 44 | while( _zmq_subscriber.recv(&msg) ) | ^ In file included from /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_monitor.h:5, from /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_monitor.cpp:1: /usr/include/zmq.hpp:1407:10: note: declared here 1407 | bool recv(message_t msg, int flags = 0) | ^~~~ /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_monitor.cpp: In member function ‘bool SidepanelMonitor::getTreeFromServer()’: /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_monitor.cpp:133:32: warning: ‘bool zmq::detail::socket_base::send(zmq::message_t&, int)’ is deprecated: from 4.3.1, use send taking message_t and send_flags [-Wdeprecated-declarations] 133 | zmq_client.send(request); | ^ In file included from /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_monitor.h:5, from /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_monitor.cpp:1: /usr/include/zmq.hpp:1326:10: note: declared here 1326 | bool send(messaget &msg, | ^~~~ /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_monitor.cpp:135:47: warning: ‘bool zmq::detail::socket_base::recv(zmq::message_t, int)’ is deprecated: from 4.3.1, use recv taking a reference to message_t and recv_flags [-Wdeprecated-declarations] 135 | bool received = zmq_client.recv(&reply); | ^ In file included from /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_monitor.h:5, from /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_monitor.cpp:1: /usr/include/zmq.hpp:1407:10: note: declared here 1407 | bool recv(message_t msg, int flags = 0) | ^~~~ In file included from /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_monitor.h:5, from /home/ritik/ilrepo/src/Groot/bt_editor/mainwindow.h:22, from /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_replay.cpp:17: /usr/include/zmq.hpp:638:14: error: ‘ZMQ_BLOCKY’ was not declared in this scope; did you mean ‘ZMQ_NOBLOCK’? 638 | blocky = ZMQ_BLOCKY, | ^~~~~~ | ZMQ_NOBLOCK /usr/include/zmq.hpp:642:31: error: ‘ZMQ_THREAD_AFFINITY_CPU_ADD’ was not declared in this scope 642 | thread_affinity_cpu_add = ZMQ_THREAD_AFFINITY_CPU_ADD, | ^~~~~~~ /usr/include/zmq.hpp:643:34: error: ‘ZMQ_THREAD_AFFINITY_CPU_REMOVE’ was not declared in this scope 643 | thread_affinity_cpu_remove = ZMQ_THREAD_AFFINITY_CPU_REMOVE, | ^~~~~~~~~~ /usr/include/zmq.hpp:644:26: error: ‘ZMQ_THREAD_NAME_PREFIX’ was not declared in this scope 644 | thread_name_prefix = ZMQ_THREAD_NAME_PREFIX, | ^~~~~~ /usr/include/zmq.hpp:645:17: error: ‘ZMQ_MAX_MSGSZ’ was not declared in this scope; did you mean ‘ZMQ_MAXMSGSIZE’? 645 | max_msgsz = ZMQ_MAX_MSGSZ, | ^~~~~ | ZMQ_MAXMSGSIZE /usr/include/zmq.hpp:652:18: error: ‘ZMQ_MSG_T_SIZE’ was not declared in this scope 652 | msg_t_size = ZMQ_MSG_T_SIZE | ^~~~~~ make[2]: [Groot/CMakeFiles/behavior_tree_editor.dir/build.make:95: Groot/CMakeFiles/behavior_tree_editor.dir/behavior_tree_editor_autogen/mocs_compilation.cpp.o] Error 1 make[2]: Waiting for unfinished jobs.... make[2]: [Groot/CMakeFiles/behavior_tree_editor.dir/build.make:264: Groot/CMakeFiles/behavior_tree_editor.dir/bt_editor/sidepanel_monitor.cpp.o] Error 1 make[2]: [Groot/CMakeFiles/behavior_tree_editor.dir/build.make:225: Groot/CMakeFiles/behavior_tree_editor.dir/bt_editor/sidepanel_replay.cpp.o] Error 1 make[2]: [Groot/CMakeFiles/behavior_tree_editor.dir/build.make:186: Groot/CMakeFiles/behavior_tree_editor.dir/bt_editor/graphic_container.cpp.o] Error 1 make[2]: [Groot/CMakeFiles/behavior_tree_editor.dir/build.make:134: Groot/CMakeFiles/behavior_tree_editor.dir/bt_editor/mainwindow.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:2778: Groot/CMakeFiles/behavior_tree_editor.dir/all] Error 2 make: [Makefile:141: all] Error 2 Invoking "make -j12 -l12" failed

I am using ROS1, there's a similar issue #159 which is not fixing for ROS1

kundezui commented 1 year ago

Do you know where I can find detailed information on learning BehaviorTree.CPP & Groot? Although there are tutorials on the official website, it is not suitable for beginners. Want to provide that kind of step-by-step detailed tutorial? @wisesama @RitikJain12 @pverma907 @lyd00116

lyd00116 commented 1 year ago

@lyd00116 Can't thank you enough, I used revert-157-Fix_Build branch and changed the CMakeList.txt file from the submit you mentioned and it worked! thanks again

Sorry,although I told you how to solve this problem,I forgot it almost in detail.So Could you tell me how to modify code to complie the revert-157-Fix_Build branch successfully? just modify those two lines? Also I do not know how to modify the Cmakelist.txt you mentioned.Thank you!