Orocos/RTT reading parameter from a different namespace

asked 2023-04-11 17:35:22 -0500

ROS_Engineer gravatar image

I am currently trying to read the the robot_description that is published on a different node than my Orocos/RTT code. The setup is as follows:

  1. Robot description is available as a parameter on /robot_state_publisher/robot_description

  2. My Orocos/RTT code runs on /rtt_node

My code looks as follows:

    RTT::Service::shared_ptr ros_service = RTT::internal::GlobalService::Instance()->getService("ros");
    RTT::OperationCaller<bool(const std::string&)> my_node = global_ros->getOperation("create_named_node");
    my_node.ready();
    my_node("rtt_node");

    RTT::Service::shared_ptr param_service = ros_service->getService("rosparam");
    RTT::OperationCaller<rclcpp::ParameterValue(std::string)> getparam_operation; 
    getparam_operation = global_params->getOperation("getParameter");
    rclcpp::ParameterValue robot_description_string = getparam_operation.call("/robot_state_publisher/robot_description");

No matter the path I try, robot_description_string remains an empty object. I have verified that /robot_state_publisher/robot_description is available and has data in it, it does. Is there any way I can change the namespace of this getparam_operation call? Or any way I can point it to /robot_state_publisher?

Much appreciated!

edit retag flag offensive close merge delete