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

Add publisher/server and autoconnect args to BT Monitor #170

Merged

Conversation

sea-bass
Copy link
Contributor

@sea-bass sea-bass commented Sep 17, 2022

This PR adds some extra options to Groot to configure the BT monitor to start with specific address and publisher/server ports, as well as automatically connect by "clicking" the Connect button in the code, if enabled.

Specifically, it lets us run Groot as follows:

ros2 run groot Groot --mode monitor --address 192.168.1.42 --publisher_port 1668 --server_port 1669 --autoconnect

The autoconnect option effectively does the following:

  • Increases the timeout for the ZMQ subscriber to 10 seconds
  • Triggers a click of the "Connect" button in code
  • The above resets the timeout to the default 1 second for users to manually connect/disconnect with the normal timeout

This addresses #133 and #166.

bt_editor/mainwindow.cpp Outdated Show resolved Hide resolved
bt_editor/mainwindow.h Outdated Show resolved Hide resolved
@Timple
Copy link
Contributor

Timple commented Oct 6, 2022

The ports are already optional, could the server ip also be passed? That would be easy to monitor a robot on a dev pc.

@sea-bass
Copy link
Contributor Author

sea-bass commented Oct 8, 2022

The ports are already optional, could the server ip also be passed? That would be easy to monitor a robot on a dev pc.

Done!

@sea-bass sea-bass force-pushed the scastro/monitor_port_connect_args branch from d9f3e4a to dff3d5b Compare October 28, 2022 13:07
@facontidavide facontidavide merged commit 89ba053 into BehaviorTree:master Feb 7, 2023
@kundezui
Copy link

kundezui commented Mar 6, 2023

The following error occurs during Groot compilation, how to solve it?

/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
, size_t 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

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

Successfully merging this pull request may close these issues.

4 participants