ros2 / rmw_dps

Implementation of the ROS Middleware (rmw) Interface using Intel's Distributed Publish & Subscribe.
Apache License 2.0
23 stars 8 forks source link

Run publisher & subscriber examples with DPS #43

Open darshanj95 opened 4 years ago

darshanj95 commented 4 years ago

I followed the installation instructions for it and got it build successfully. (https://github.com/ros2/rmw_dps 2)

After doing this, I switched from default rmw to rmw_dps by specifying the environment variable.

export RMW_IMPLEMENTATION=rmw_dps_cpp

And then I tried running talker demo (ros2 run demo_nodes_cpp talker) and listener demo node, but the listener node couldn’t get the read the message. When I tried to echo the topic from talker node, I got this message:

Could not determine the type for the passed topic

Could someone point out what is going on here? Thank you!

malsbat commented 4 years ago

There has likely been some changes to the RMW APIs that rmw_dps_cpp is not up to date with. I suggest enabling debug logging by setting the the level to RCUTILS_LOG_SEVERITY_DEBUG at https://github.com/ros2/rmw_dps/blob/bf93b10cfa71cbeeaec0f5d01b86ebc35f45490d/rmw_dps_cpp/src/rmw_init.cpp#L101 and seeing what APIs are called immediately prior to the message you see and see if there's been some changes to those APIs recently.

darshanj95 commented 4 years ago

Thank you @malsbat for getting back. I enabled logging and saw this. What can you make up from these logs? Does this look normal?

After running the talker node

DJain6@1001911-ubuntu:~/ros2_eloquent$ export RMW_IMPLEMENTATION=rmw_dps_cpp
DJain6@1001911-ubuntu:~/ros2_eloquent$ ros2 run demo_nodes_cpp talker
[DEBUG] [rmw_dps_cpp]: rmw_create_node(name=talker,namespace_=/,domain_id=0,security_options={enforce_security=0,security_root_path=(null)},localhost_only=0)
[DEBUG] [rmw_dps_cpp]: rmw_node_get_graph_guard_condition(node=0x5618d27f8200)
[DEBUG] [rmw_dps_cpp]: rmw_create_publisher(node=0x5618d27f8200,type_supports=0x7ff4c2bab0b0,topic_name=/rosout,qos_policies={history=KEEP_LAST,depth=10,reliability=RELIABLE,durability=VOLATILE},publisher_options=0x7ffcfb14e440)
[DEBUG] [rmw_dps_cpp]: rmw_create_service(node=0x5618d27f8200,type_supports=0x7ff4c462f310,service_name=/talker/get_parameters,qos_policies={history=1,depth=1000,reliability=1,durability=2})
[DEBUG] [rmw_dps_cpp]: rmw_create_service(node=0x5618d27f8200,type_supports=0x7ff4c462f370,service_name=/talker/get_parameter_types,qos_policies={history=1,depth=1000,reliability=1,durability=2})
[DEBUG] [rmw_dps_cpp]: rmw_create_service(node=0x5618d27f8200,type_supports=0x7ff4c462f490,service_name=/talker/set_parameters,qos_policies={history=1,depth=1000,reliability=1,durability=2})
[DEBUG] [rmw_dps_cpp]: rmw_create_service(node=0x5618d27f8200,type_supports=0x7ff4c462f430,service_name=/talker/set_parameters_atomically,qos_policies={history=1,depth=1000,reliability=1,durability=2})
[DEBUG] [rmw_dps_cpp]: rmw_create_service(node=0x5618d27f8200,type_supports=0x7ff4c462f2b0,service_name=/talker/describe_parameters,qos_policies={history=1,depth=1000,reliability=1,durability=2})
[DEBUG] [rmw_dps_cpp]: rmw_create_service(node=0x5618d27f8200,type_supports=0x7ff4c462f3d0,service_name=/talker/list_parameters,qos_policies={history=1,depth=1000,reliability=1,durability=2})
[DEBUG] [rmw_dps_cpp]: rmw_create_publisher(node=0x5618d27f8200,type_supports=0x7ff4c462f1d0,topic_name=/parameter_events,qos_policies={history=KEEP_LAST,depth=1000,reliability=RELIABLE,durability=VOLATILE},publisher_options=0x7ffcfb1554b0)
[DEBUG] [rmw_dps_cpp]: rmw_get_gid_for_publisher(publisher=0x5618d280dca0,gid=0x5618d280de28)
[DEBUG] [rmw_dps_cpp]: rmw_publish(publisher=0x5618d280dca0,ros_message=0x7ffcfb155380,allocation=(nil))
[DEBUG] [rmw_dps_cpp]: rmw_create_subscription(node=0x5618d27f8200,type_supports=0x7ff4c462f1d0,topic_name=/parameter_events,qos_policies={history=KEEP_LAST,depth=1000,reliability=RELIABLE,durability=VOLATILE},subscription_options=0x7ffcfb1548b0)
[DEBUG] [rmw_dps_cpp]: rmw_create_publisher(node=0x5618d27f8200,type_supports=0x7ff4c04d53c0,topic_name=/chatter,qos_policies={history=KEEP_LAST,depth=7,reliability=RELIABLE,durability=VOLATILE},publisher_options=0x7ffcfb1559c0)
[DEBUG] [rmw_dps_cpp]: rmw_get_gid_for_publisher(publisher=0x5618d2815e90,gid=0x5618d2815378)
[DEBUG] [rmw_dps_cpp]: onDiscovery(service=0x5618d2800ca0,pub=0x7ff4b8001bd0,payload=0x7ff4b80016da,len=1250)
[DEBUG] [rmw_dps_cpp]: onDiscovery(service=0x5618d2800ca0,pub=0x7ff4b8001e00,payload=0x7ff4b8001630,len=1265)
[DEBUG] [rmw_dps_cpp]: onDiscovery(service=0x5618d2800ca0,pub=0x7ff4b8001630,payload=0x7ff4b8003090,len=183)
[DEBUG] [rmw_dps_cpp]: onDiscovery(service=0x5618d2800ca0,pub=0x7ff4b8004950,payload=0x7ff4b80055c0,len=1250)
[DEBUG] [rmw_dps_cpp]: onDiscovery(service=0x5618d2800ca0,pub=0x7ff4b8004c10,payload=0x7ff4b8000bc0,len=240)
[INFO] [talker]: Publishing: 'Hello World: 1'
[DEBUG] [rmw_dps_cpp]: rmw_publish(publisher=0x5618d2801cd0,ros_message=0x5618d280a750,allocation=(nil))
[DEBUG] [rmw_dps_cpp]: rmw_publish(publisher=0x5618d2815e90,ros_message=0x5618d2816bd0,allocation=(nil))
[DEBUG] [rmw_dps_cpp]: onDiscovery(service=0x5618d2800ca0,pub=0x7ff4b80057d0,payload=0x7ff4b800613a,len=1250)
[DEBUG] [rmw_dps_cpp]: onDiscovery(service=0x5618d2800ca0,pub=0x7ff4b80053b0,payload=0x7ff4b8004f90,len=240)
[DEBUG] [rmw_dps_cpp]: onDiscovery(service=0x5618d2800ca0,pub=0x7ff4b80053b0,payload=0x7ff4b8003090,len=183)
[DEBUG] [rmw_dps_cpp]: onDiscovery(service=0x5618d2800ca0,pub=0x7ff4b80053b0,payload=0x7ff4b8006090,len=1265)
[DEBUG] [rmw_dps_cpp]: onDiscovery(service=0x5618d2800ca0,pub=0x7ff4b8005360,payload=0x7ff4b80075b0,len=1250)
[INFO] [talker]: Publishing: 'Hello World: 2'
[DEBUG] [rmw_dps_cpp]: rmw_publish(publisher=0x5618d2801cd0,ros_message=0x5618d2816030,allocation=(nil))
[DEBUG] [rmw_dps_cpp]: rmw_publish(publisher=0x5618d2815e90,ros_message=0x5618d2816bd0,allocation=(nil))
[INFO] [talker]: Publishing: 'Hello World: 3'
[DEBUG] [rmw_dps_cpp]: rmw_publish(publisher=0x5618d2801cd0,ros_message=0x5618d28162f0,allocation=(nil))
[DEBUG] [rmw_dps_cpp]: rmw_publish(publisher=0x5618d2815e90,ros_message=0x5618d2816bd0,allocation=(nil))
[DEBUG] [rmw_dps_cpp]: onDiscovery(service=0x5618d2800ca0,pub=0x7ff4b8005340,payload=0x7ff4b80070da,len=1250)
[DEBUG] [rmw_dps_cpp]: onDiscovery(service=0x5618d2800ca0,pub=0x7ff4b8005320,payload=0x7ff4b8006a40,len=240)
[DEBUG] [rmw_dps_cpp]: onDiscovery(service=0x5618d2800ca0,pub=0x7ff4b8005320,payload=0x7ff4b8007030,len=1265)
[DEBUG] [rmw_dps_cpp]: onDiscovery(service=0x5618d2800ca0,pub=0x7ff4b8005320,payload=0x7ff4b8007030,len=1250)
[DEBUG] [rmw_dps_cpp]: onDiscovery(service=0x5618d2800ca0,pub=0x7ff4b80065d0,payload=0x7ff4b8003090,len=183)
[INFO] [talker]: Publishing: 'Hello World: 4'
[DEBUG] [rmw_dps_cpp]: rmw_publish(publisher=0x5618d2801cd0,ros_message=0x5618d2821a50,allocation=(nil))
[DEBUG] [rmw_dps_cpp]: rmw_publish(publisher=0x5618d2815e90,ros_message=0x5618d2816bd0,allocation=(nil))
.
(skipping to end)
.
^C[INFO] [rclcpp]: signal_handler(signal_value=2)
[DEBUG] [rmw_dps_cpp]: rmw_shutdown()
[DEBUG] [rmw_dps_cpp]: rmw_destroy_publisher(node=0x5618d27f8200,publisher=0x5618d2801cd0)
[DEBUG] [rmw_dps_cpp]: rmw_destroy_publisher(node=0x5618d27f8200,publisher=0x5618d2815e90)
[DEBUG] [rmw_dps_cpp]: rmw_destroy_subscription(node=0x5618d27f8200,subscription=0x5618d2807510)
[DEBUG] [rmw_dps_cpp]: rmw_destroy_service(node=0x5618d27f8200,service=0x5618d280dd50)
[DEBUG] [rmw_dps_cpp]: rmw_destroy_service(node=0x5618d27f8200,service=0x5618d280c170)
[DEBUG] [rmw_dps_cpp]: rmw_destroy_service(node=0x5618d27f8200,service=0x5618d280bb40)
[DEBUG] [rmw_dps_cpp]: rmw_destroy_service(node=0x5618d27f8200,service=0x5618d2809ca0)
[DEBUG] [rmw_dps_cpp]: rmw_destroy_service(node=0x5618d27f8200,service=0x5618d2807f80)
[DEBUG] [rmw_dps_cpp]: rmw_destroy_service(node=0x5618d27f8200,service=0x5618d2806e30)
[DEBUG] [rmw_dps_cpp]: rmw_destroy_publisher(node=0x5618d27f8200,publisher=0x5618d280dca0)
[DEBUG] [rmw_dps_cpp]: rmw_destroy_node(node=0x5618d27f8200)
[DEBUG] [rmw_dps_cpp]: onDiscovery(service=0x5618d2800ca0,pub=0x7ff4b8006090,payload=(nil),len=0)

After running listener node


DJain6@1001911-ubuntu:~/ros2_eloquent$ ros2 run demo_nodes_cpp listener
[DEBUG] [rmw_dps_cpp]: rmw_create_node(name=listener,namespace_=/,domain_id=0,security_options={enforce_security=0,security_root_path=(null)},localhost_only=0)
[DEBUG] [rmw_dps_cpp]: rmw_node_get_graph_guard_condition(node=0x55e846019210)
[DEBUG] [rmw_dps_cpp]: rmw_create_publisher(node=0x55e846019210,type_supports=0x7f606b1070b0,topic_name=/rosout,qos_policies={history=KEEP_LAST,depth=10,reliability=RELIABLE,durability=VOLATILE},publisher_options=0x7fffc1b8c040)
[DEBUG] [rmw_dps_cpp]: rmw_create_service(node=0x55e846019210,type_supports=0x7f606cb8b310,service_name=/listener/get_parameters,qos_policies={history=1,depth=1000,reliability=1,durability=2})
[DEBUG] [rmw_dps_cpp]: rmw_create_service(node=0x55e846019210,type_supports=0x7f606cb8b370,service_name=/listener/get_parameter_types,qos_policies={history=1,depth=1000,reliability=1,durability=2})
[DEBUG] [rmw_dps_cpp]: rmw_create_service(node=0x55e846019210,type_supports=0x7f606cb8b490,service_name=/listener/set_parameters,qos_policies={history=1,depth=1000,reliability=1,durability=2})
[DEBUG] [rmw_dps_cpp]: rmw_create_service(node=0x55e846019210,type_supports=0x7f606cb8b430,service_name=/listener/set_parameters_atomically,qos_policies={history=1,depth=1000,reliability=1,durability=2})
[DEBUG] [rmw_dps_cpp]: rmw_create_service(node=0x55e846019210,type_supports=0x7f606cb8b2b0,service_name=/listener/describe_parameters,qos_policies={history=1,depth=1000,reliability=1,durability=2})
[DEBUG] [rmw_dps_cpp]: rmw_create_service(node=0x55e846019210,type_supports=0x7f606cb8b3d0,service_name=/listener/list_parameters,qos_policies={history=1,depth=1000,reliability=1,durability=2})
[DEBUG] [rmw_dps_cpp]: rmw_create_publisher(node=0x55e846019210,type_supports=0x7f606cb8b1d0,topic_name=/parameter_events,qos_policies={history=KEEP_LAST,depth=1000,reliability=RELIABLE,durability=VOLATILE},publisher_options=0x7fffc1b930b0)
[DEBUG] [rmw_dps_cpp]: rmw_get_gid_for_publisher(publisher=0x55e846027970,gid=0x55e84602c618)
[DEBUG] [rmw_dps_cpp]: rmw_publish(publisher=0x55e846027970,ros_message=0x7fffc1b92f80,allocation=(nil))
[DEBUG] [rmw_dps_cpp]: rmw_create_subscription(node=0x55e846019210,type_supports=0x7f606cb8b1d0,topic_name=/parameter_events,qos_policies={history=KEEP_LAST,depth=1000,reliability=RELIABLE,durability=VOLATILE},subscription_options=0x7fffc1b924b0)
[DEBUG] [rmw_dps_cpp]: rmw_create_subscription(node=0x55e846019210,type_supports=0x7f6068a313c0,topic_name=/chatter,qos_policies={history=KEEP_LAST,depth=10,reliability=RELIABLE,durability=VOLATILE},subscription_options=0x7fffc1b93170)
[DEBUG] [rmw_dps_cpp]: onDiscovery(service=0x55e846021c90,pub=0x7f6064001be0,payload=0x7f60640016dd,len=1265)
[DEBUG] [rmw_dps_cpp]: onDiscovery(service=0x55e846021c90,pub=0x7f6064001e10,payload=0x7f6064001630,len=1250)
[DEBUG] [rmw_dps_cpp]: onDiscovery(service=0x55e846021c90,pub=0x7f6064001790,payload=0x7f6064005260,len=1265)
[DEBUG] [rmw_dps_cpp]: onDiscovery(service=0x55e846021c90,pub=0x7f60640048a0,payload=0x7f60640030b0,len=183)
[DEBUG] [rmw_dps_cpp]: onDiscovery(service=0x55e846021c90,pub=0x7f6064004b90,payload=0x7f6064000bc0,len=240)
[DEBUG] [rmw_dps_cpp]: onDiscovery(service=0x55e846021c90,pub=0x7f6064005280,payload=0x7f606400654d,len=1265
.
(skipping to end)
.What can you make up from these logs? Does this look normal?
^C[INFO] [rclcpp]: signal_handler(signal_value=2)
[DEBUG] [rmw_dps_cpp]: rmw_shutdown()
[DEBUG] [rmw_dps_cpp]: rmw_destroy_publisher(node=0x55e846019210,publisher=0x55e846022d00)
[DEBUG] [rmw_dps_cpp]: rmw_destroy_subscription(node=0x55e846019210,subscription=0x55e846038370)
[DEBUG] [rmw_dps_cpp]: rmw_destroy_subscription(node=0x55e846019210,subscription=0x55e846025340)
[DEBUG] [rmw_dps_cpp]: rmw_destroy_service(node=0x55e846019210,service=0x55e84602b150)
[DEBUG] [rmw_dps_cpp]: rmw_destroy_service(node=0x55e846019210,service=0x55e84602d7e0)
[DEBUG] [rmw_dps_cpp]: rmw_destroy_service(node=0x55e846019210,service=0x55e84602d010)
[DEBUG] [rmw_dps_cpp]: rmw_destroy_service(node=0x55e846019210,service=0x55e84602aba0)
[DEBUG] [rmw_dps_cpp]: rmw_destroy_service(node=0x55e846019210,service=0x55e846028ed0)
[DEBUG] [rmw_dps_cpp]: rmw_destroy_service(node=0x55e846019210,service=0x55e846024650)
[DEBUG] [rmw_dps_cpp]: rmw_destroy_publisher(node=0x55e846019210,publisher=0x55e846027970)
[DEBUG] [rmw_dps_cpp]: rmw_destroy_node(node=0x55e846019210)
[DEBUG] [rmw_dps_cpp]: onDiscovery(service=0x55e846021c90,pub=0x7f6064007fd0,payload=(nil),len=0)
darshanj95 commented 4 years ago

Did you get a chance to look at the logs @malsbat?