Trace does not work in exercise 5.4

Trace does not work in exercise 5.4 with the handed out code.
It seems that it cannot find the callback functions, maybe due to the use of bind()? I have now also tried with lamdas but I get the same error when calling the trace function.
Can you try to run this exercise using the handed out code to see if it works on your PC with the trace function?
See screenshot

Compile error:
CALLBACK SYMBOLS ================
{93854485611992: ‘rclcpp::TimeSource::NodeState::attachNode(std::shared_ptrrclcpp::node_interfaces::NodeBaseInterface,std::shared_ptrrclcpp::node_interfaces::NodeTopicsInterface,std::shared_ptrrclcpp::node_interfaces::NodeGraphInterface,std::shared_ptrrclcpp::node_interfaces::NodeServicesInterface,std::shared_ptrrclcpp::node_interfaces::NodeLoggingInterface,std::shared_ptrrclcpp::node_interfaces::NodeClockInterface,std::shared_ptrrclcpp::node_interfaces::NodeParametersInterface)::{lambda(std::shared_ptr<rcl_interfaces::msg::ParameterEventconst>)#1}’, 93854485706640: ‘RobotStatus::RobotStatus()::{lambda()#1}’, 93854485706976: ‘RobotStatus::RobotStatus()::{lambda()#2}’}
Traceback (most recent call last):
File “/home/simulations/ros2_sims_ws/install/ros2_callback_visualiser/lib/ros2_callback_visualiser/analise_trace_calback_function.py”, line 137, in
ranges_timer_counter = get_timer_callback_ranges(‘robot_status’, ‘timer_counter’)
File “/home/simulations/ros2_sims_ws/install/ros2_callback_visualiser/lib/ros2_callback_visualiser/analise_trace_calback_function.py”, line 65, in get_timer_callback_ranges
assert 1 == len(timer_objs), f’len={len(timer_objs)}’
AssertionError: len=0

Update: same issue also applies to exercises in chapter 6.3 when calling
ros2 run ros2_callback_visualiser analise_trace_plant_searcher_callbacks.py
output:
output written to: /home/user/.ros/tracing/plant_detector/converted
[100%] [Ros2Handler]
CALLBACK SYMBOLS ================
{94799263800856: ‘rclcpp::TimeSource::NodeState::attachNode(std::shared_ptrrclcpp::node_interfaces::NodeBaseInterface,std::shared_ptrrclcpp::node_interfaces::NodeTopicsInterface,std::shared_ptrrclcpp::node_interfaces::NodeGraphInterface,std::shared_ptrrclcpp::node_interfaces::NodeServicesInterface,std::shared_ptrrclcpp::node_interfaces::NodeLoggingInterface,std::shared_ptrrclcpp::node_interfaces::NodeClockInterface,std::shared_ptrrclcpp::node_interfaces::NodeParametersInterface)::{lambda(std::shared_ptr<rcl_interfaces::msg::ParameterEventconst>)#1}’, 94799264075520: ‘void (PlantDetectorNode::?)(std::shared_ptr<std_srvs::srv::Trigger_Request>,std::shared_ptr<std_srvs::srv::Trigger_Response>)’, 94799263906808: ‘void (PlantDetectorNode::?)(std::shared_ptr<sensor_msgs::msg::Image>)’}
Traceback (most recent call last):
File “/home/simulations/ros2_sims_ws/install/ros2_callback_visualiser/lib/ros2_callback_visualiser/analise_trace_plant_searcher_callbacks.py”, line 175, in
ranges_listener_callback = get_sub_callback_ranges(‘listener_callback’, ‘/leo/camera/image_raw’, ‘plant_detector_node’)
File “/home/simulations/ros2_sims_ws/install/ros2_callback_visualiser/lib/ros2_callback_visualiser/analise_trace_plant_searcher_callbacks.py”, line 72, in get_sub_callback_ranges
assert 1 == len(sub_objs), "In a node there should be only ONE subscriber to the same topic, "+f’len={len(sub_objs)}’
AssertionError: In a node there should be onl

Checking this@soren.rusbjerg. Thanks for bringing it up

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.