Skip to content

Commit

Permalink
changed discovery process in ROS2
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Tiderko committed Aug 18, 2023
1 parent 329a475 commit 5dd24b5
Show file tree
Hide file tree
Showing 19 changed files with 219 additions and 835 deletions.
3 changes: 0 additions & 3 deletions fkie_master_discovery/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,10 @@ if ( ament_cmake_FOUND )
rmw_fastrtps_shared_cpp
lifecycle_msgs
)
list(APPEND DEPS rmw_dds_common)
list(APPEND DEPS rmw_fastrtps_cpp)
list(APPEND DEPS rosidl_typesupport_fastrtps_cpp)
include_directories(${catkin_INCLUDE_DIRS})
add_executable(master_discovery
src/eprosima_pariticipant_listener.cpp
src/message_type_support.cpp
)
ament_target_dependencies(master_discovery ${DEPS})

Expand Down
2 changes: 0 additions & 2 deletions fkie_master_discovery/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
<depend condition="$ROS_VERSION == 2">lifecycle_msgs</depend>
<depend condition="$ROS_VERSION == 2">rclcpp</depend>
<depend condition="$ROS_VERSION == 2">rclcpp_lifecycle</depend>
<depend condition="$ROS_VERSION == 2">rosidl_typesupport_fastrtps_cpp</depend>
<depend condition="$ROS_VERSION == 2">rmw_dds_common</depend>
<depend condition="$ROS_VERSION == 2">rmw_fastrtps_cpp</depend>
<depend condition="$ROS_VERSION == 2">rmw_fastrtps_shared_cpp</depend>

Expand Down
453 changes: 51 additions & 402 deletions fkie_master_discovery/src/eprosima_pariticipant_listener.cpp

Large diffs are not rendered by default.

212 changes: 0 additions & 212 deletions fkie_master_discovery/src/message_type_support.cpp

This file was deleted.

48 changes: 0 additions & 48 deletions fkie_master_discovery/src/message_type_support.hpp

This file was deleted.

2 changes: 0 additions & 2 deletions fkie_multimaster_msgs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ if ( ament_cmake_FOUND )
"msg2/DiscoveredState.msg"
"msg2/Endpoint.msg"
"msg2/Gid.msg"
"msg2/NodeEntitiesInfo.msg"
"msg2/ParticipantEntitiesInfo.msg"
"msg2/Qos.msg"
"msg2/TopicEntity.msg"
"srv/ListNodes.srv"
"srv/LoadLaunch.srv"
"srv/Task.srv"
Expand Down
8 changes: 1 addition & 7 deletions fkie_multimaster_msgs/msg2/DiscoveredState.msg
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
# true if massage contains the complete discovered status.
bool full_state

# If full_state is False, the list contains only new or updated participants.
# The list of all participants
ParticipantEntitiesInfo[] participants

# Removed_participants list is always empty if full_state is True, otherwise the list contains removed participants.
Gid[] removed_participants
4 changes: 0 additions & 4 deletions fkie_multimaster_msgs/msg2/NodeEntitiesInfo.msg

This file was deleted.

2 changes: 0 additions & 2 deletions fkie_multimaster_msgs/msg2/ParticipantEntitiesInfo.msg
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
Gid guid
string enclave
string[] unicast_locators
NodeEntitiesInfo[] node_entities
TopicEntity[] topic_entities
12 changes: 0 additions & 12 deletions fkie_multimaster_msgs/msg2/TopicEntity.msg

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ class CrossbarBaseSession(ApplicationSession):

def __init__(self, loop: asyncio.AbstractEventLoop, realm: str = 'ros', port: int = 11911, test_env=False) -> None:
self.port = port
self.realm = realm
self.crossbar_loop = loop
self._on_shutdown = False
self._crossbar_subscriptions = [] # list of tuples (topic, handler)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ def __init__(self, id: str, name: str) -> None:
self.screens: List[str] = []
self.parameters: List[RosParameter] = []
self.system_node = False
self.enclave = ''

def __str__(self):
return json.dumps(dict(self), ensure_ascii=False)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ def test_screen() -> None:
# try to fix empty LD_LIBRARY_PATH path issues in screen
if os.environ['LD_LIBRARY_PATH']:
os.environ['LD_LIBRARY_PATH_SCRREN'] = os.environ['LD_LIBRARY_PATH']
with open('%s/screen.cfg' % SETTINGS_PATH, 'w') as sf:
if not os.path.exists(SETTINGS_PATH):
os.makedirs(SETTINGS_PATH)
with open(os.path.join(SETTINGS_PATH, 'screen.cfg'), 'w') as sf:
sf.write('logfile flush 0\n')
sf.write('setenv LD_LIBRARY_PATH $LD_LIBRARY_PATH_SCRREN\n')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ def call_service(self, request_json: LaunchCallService) -> None:
cli.wait_for_service()
Log.debug('requester: making request: %r' % service_request)
future = cli.call_async(service_request)
rclpy.spin_until_future_complete(nmd.ros_node, future)
rclpy.spin_until_future_complete(nmd.ros_node, future, nmd.launcher.executor, 30.0)
if future.result() is not None:
result.data = message_to_ordereddict(future.result())
result.valid = True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
from ros2run.api import run_executable
import composition_interfaces.srv

from fkie_multimaster_pylib.grpc_helper import remote
from .launch_config import LaunchConfig
from .launch_config import LaunchNodeWrapper
from launch.launch_context import LaunchContext
Expand Down
Loading

0 comments on commit 5dd24b5

Please sign in to comment.