Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Question How to list up nodes??

Discussion in 'Robotics' started by Furret_, Sep 20, 2022.

  1. Furret_

    Furret_

    Joined:
    Nov 5, 2018
    Posts:
    5
    Hi there, I'm trying to build something simaliar with rqt_graph that shows the connections of all nodes lists topics. I found the "AllTopic" property in RosConnection, and RosMessageName in RosTopicState, but couldn't find any informations about the nodes. Is this not supported?

    Actually I'm not used to ROS that much yet, I do not even have the understanding about making the "rosnode list" command that can be run on the terminal. What do I have to do to get the node info using unity ros???


    P.S.
    And it could be very helpful if there is an document about the API of Unity.Robotics for people who are not well understanding ROS. It took time for me to figure out the property "AllTopic" and others because I couldn't find any explanations about this awsome package. I just found them using the automatic text complete function provided in the IDE, which made me to just guess what they mean.
     
    Last edited: Sep 21, 2022
  2. LaurieUnity

    LaurieUnity

    Unity Technologies

    Joined:
    Oct 23, 2020
    Posts:
    77
    Sorry, RosConnection doesn't have a way to get information about nodes right now. (AllTopics was added to support visualizations; we haven't had a reason to do the same for nodes).
     
  3. Furret_

    Furret_

    Joined:
    Nov 5, 2018
    Posts:
    5
    Thanks, for your answer sir. I think one of the strongest advantage that Unity have is the UI. I think that it can be useful if we can replace dozens of rqt_~~~ gui by wrapping them in 1 big unity program. Right now I'm trying to make an substitute of the "rqt_reconfigure".

    Well I have another question about this. In this case I need to send some data directly to the dynamic_reconfigure Server, which rqt_reconfigure acts as a client. Is this also impossible?
     
  4. LaurieUnity

    LaurieUnity

    Unity Technologies

    Joined:
    Oct 23, 2020
    Posts:
    77
    Hi, I guess you also opened this as an issue on the Ros-Tcp-Connector repo :) This is probably a better place to discuss it.
    How is data usually sent to the dynamic_reconfigure server? If it's using the regular publish/subscribe mechanism, you should be able to do the same thing with Ros-Tcp-Connector.
     
  5. Furret_

    Furret_

    Joined:
    Nov 5, 2018
    Posts:
    5

    Hi Laurie, thanks for your interest. First I can say that dynamic reconfigure is not using an usual publish/subscribe mechanism. I'll show you a rqt_graph diagram when we open a dynamic server.

    Screenshot from 2022-10-07 18-52-47.png


    Here, you can see a node named "calibration_lidar_imu". In this node, there is a code like this:


    dynamic_reconfigure::Server<mobiltech_lidar_imu_calibration::LidarCalibConfig> server;
    dynamic_reconfigure::Server<mobiltech_lidar_imu_calibration::LidarCalibConfig>::CallbackType f;
    f = boost::bind(&reconfCallback, _1, _2);
    server.setCallback(f);



    And also you can see the "unity endpoint" is subscribing and publishing to /calibration~~/parameter_updates

    I tried to update the ros parameters just by publishing it, but that hadn't work to make the server to know it was updated. When I check the value of them using "rosparam get (param name)", it seems that the value failed in updating.

    But the thing that is interesting is that when we open a rqt_reconfigure which is equal to "rqt_gui_py" node, (by running "rosrun rqt_reconfigure rqt_reconfigure"), we can see all the parameters and update them by the gui. Also, these are "dynamic parameters" which is different with just "parameters". This is the window of rqt_reconfigure.

    Screenshot from 2022-10-07 18-45-18.png

    Now the important thing is this: When you see the diagram, you can check that "rqt_gui_py_node" is subscribing "parameter_updates", but not publishing to it. This means that there is another way how rqt_reconfigure updates the parameters, and I suspect this is just done by a simple socket programming.

    It's a shame that I can't share the calib~ node with you so that you can test with it, but I think the unityRos developers must need to understand the dynamic_reconfigure first. Actually I don't exactly know about this myself. But, as you can assume, this can be an overload, and also if my knowledge is correct, it has been depricated in Ros2 (I heard that it only works in Ros1).


    Well actually, I had to do update those params, so I did something like cheating: I just made a new Process, and runned bin/bash on it, and just thrown an message.
    "rosrun dynamic_reconfigure dynparam set /calibration_lidar_imu (param name)"

    but, as you know, this is not an ordinary approach, so it could be good if there is an api that serves something like this.
     
  6. LaurieUnity

    LaurieUnity

    Unity Technologies

    Joined:
    Oct 23, 2020
    Posts:
    77
    Ok, so basically you can't skip calling the dynamic_reconfigure API. :)
    Sounds like you want to make your own dynamic_reconfigure_receiver ros node that subscribes to an arbitrary topic you've chosen. Publish your own custom messages from Unity with all the information about the dynamic_reconfigure settings you want it to set, and then your node can call the dynamic_reconfigure API based on those messages.
     
    Last edited: Oct 13, 2022