How to get ros2 param list to work with simple custom node?
I have following test.cpp:
#include <project/test.h>
void signalHandler(int signum){
std::cerr << "Received signal" << std::endl;
rclcpp::shutdown();
}
int main(int argc, char * argv[])
{
signal(SIGTERM, signalHandler);
rclcpp::init(argc, argv);
rclcpp::executors::SingleThreadedExecutor exe;
std::shared_ptr<Foo> lc_node = std::make_shared<Foo>();
exe.add_node(lc_node->get_node_base_interface());
exe.spin();
// rclcpp::shutdown();
std::cerr << "Closed" << std::endl;
return 0;
}
with test.h just being:
#include <rclcpp/rclcpp.hpp>
#include <rclcpp_lifecycle/lifecycle_node.hpp>
class Foo : public rclcpp_lifecycle::LifecycleNode {
public:
Foo() : rclcpp_lifecycle::LifecycleNode("foo"){
std::cerr << "Running test node" << std::endl;
};
private:
};
now I can run the node successfully directly from clion and everything works, callbacks get called topics get published and I see my published markers in rviz. Now I wanted to integrate with rqt but when I try to click on the node it just freezes and gives me following error message:
[WARN] [1630415189.108735450] [rqt_reconfigure]: Failed to retrieve parameters from node: asynchronous service call failed: the target node may not be spinning
ros2 param list
returns Exception while calling service of node '/foo': None
What am I missing? Why can't I get the parameters of my node?