From 35db38bd6ea04beac1821f84f6cce1e07add47f4 Mon Sep 17 00:00:00 2001 From: Katie Hamilton Date: Mon, 9 Dec 2024 14:37:22 -0800 Subject: [PATCH] Rewrote ground bridge readme and made it less ISAAC specific. --- .../dds_ground_bridge/NDDS_DISCOVERY_PEERS | 17 + .../dds_ground_bridge/RAPID_QOS_PROFILES.xml | 989 ++++++++++++++++++ .../ground_dds_ros_bridge.config | 2 +- .../ground_dds_ros_bridge/readme.md | 72 +- .../src/ground_dds_ros_bridge.cc | 4 +- 5 files changed, 1063 insertions(+), 21 deletions(-) create mode 100644 astrobee/config/communications/dds_ground_bridge/NDDS_DISCOVERY_PEERS create mode 100644 astrobee/config/communications/dds_ground_bridge/RAPID_QOS_PROFILES.xml diff --git a/astrobee/config/communications/dds_ground_bridge/NDDS_DISCOVERY_PEERS b/astrobee/config/communications/dds_ground_bridge/NDDS_DISCOVERY_PEERS new file mode 100644 index 0000000000..35ef791374 --- /dev/null +++ b/astrobee/config/communications/dds_ground_bridge/NDDS_DISCOVERY_PEERS @@ -0,0 +1,17 @@ +;; NDDS_DISCOVERY_PEERS - Default Discovery Configuration File +;;Multicast builtin.udpv4://239.255.0.1 ; default discovery multicast addr +; EVERY LINE IN THIS FILE MUST END IN A COMMENT. Even blank lines. +; +;; Shared Memory +;shmem:// ; All 'shmem' transport plugin(s) +;builtin.shmem:// ; The builtin builtin 'shmem' transport plugin + ; at network address FCC0::0 +; +;; Unicast +; +;; Localhost +127.0.0.1 ; A comma can be used a separator +; +;; Granite Lab - P4 +; +;; Custom entries below this line (Vagrant, etc) diff --git a/astrobee/config/communications/dds_ground_bridge/RAPID_QOS_PROFILES.xml b/astrobee/config/communications/dds_ground_bridge/RAPID_QOS_PROFILES.xml new file mode 100644 index 0000000000..e4123aee6c --- /dev/null +++ b/astrobee/config/communications/dds_ground_bridge/RAPID_QOS_PROFILES.xml @@ -0,0 +1,989 @@ + + + + + + + + + + + + + + + 50, 48, 49, 49, 48, 54,0x32,0x39,0x2e,0x30,0x39,0x34,0x33,0x30,0x30,0x2e,0x48,0x55,0x2d,0x41,0x52,0x43 + + + + + 7400 + 250 + 2 + 0 + 10 + 1 + 11 + + MASK_DEFAULT + + + UDPv4 + + + + + + true + + + + 4096 + + + 0 + 0 + + + + + + + + + + + dds.flow_controller.token_bucket.MeshFlowController.scheduling_policy + DDS_EDF_FLOW_CONTROLLER_SCHED_POLICY + + + dds.flow_controller.token_bucket.MeshFlowController.token_bucket.max_tokens + 12 + + + dds.flow_controller.token_bucket.MeshFlowController.token_bucket.tokens_added_per_period + 4 + + + dds.flow_controller.token_bucket.MeshFlowController.token_bucket.tokens_leaked_per_period + 0 + + + dds.flow_controller.token_bucket.MeshFlowController.token_bucket.bytes_per_token + 1250 + + + dds.flow_controller.token_bucket.MeshFlowController.token_bucket.period.sec + 0 + + + dds.flow_controller.token_bucket.MeshFlowController.token_bucket.period.nanosec + 5000000 + + + + + + + dds.transport.UDPv4.builtin.parent.message_size_max + 1250 + + + dds.transport.UDPv4.builtin.send_socket_buffer_size + 65535 + + + dds.transport.UDPv4.builtin.recv_socket_buffer_size + 65535 + + + + + dds.transport.shmem.builtin.received_message_count_max + 512 + + + dds.transport.shmem.builtin.receive_buffer_size + 1048576 + + + + + dds.transport.UDPv4.builtin.parent.deny_interfaces + 128.102.*,10.10.1.*,10.30.10.*,192.168.3.255,169.254.194.2,192.9.202.1,192.168.5.*,192.168.10.*,192.168.122.* + + + dds.transport.UDPv4.builtin.parent.deny_multicast_interfaces + 128.102.*,10.10.1.*,10.30.10.*,192.168.3.255,169.254.194.2,192.9.202.1,192.168.5.*,192.168.10.*,192.168.122.* + + + + + + + + + + + + 0 + + + + + + ALIVE_THEN_DISPOSED_INSTANCE_REPLACEMENT + + + ASYNCHRONOUS_PUBLISH_MODE_QOS + + + + + + + + + + BEST_EFFORT_RELIABILITY_QOS + + + KEEP_LAST_HISTORY_QOS + 5 + + + + + BEST_EFFORT_RELIABILITY_QOS + + + KEEP_LAST_HISTORY_QOS + 5 + + + + + + + + + + RELIABLE_RELIABILITY_QOS + + + KEEP_ALL_HISTORY_QOS + + + + + RELIABLE_RELIABILITY_QOS + + + + KEEP_ALL_HISTORY_QOS + + + + + + + + + + RELIABLE_RELIABILITY_QOS + + + TRANSIENT_LOCAL_DURABILITY_QOS + + + KEEP_LAST_HISTORY_QOS + 1 + + + + + RELIABLE_RELIABILITY_QOS + + + TRANSIENT_LOCAL_DURABILITY_QOS + + + KEEP_LAST_HISTORY_QOS + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RELIABLE_RELIABILITY_QOS + + + + + RELIABLE_RELIABILITY_QOS + + + + + + + + TRANSIENT_LOCAL_DURABILITY_QOS + + + KEEP_LAST_HISTORY_QOS + 6 + + + + + TRANSIENT_LOCAL_DURABILITY_QOS + + + KEEP_LAST_HISTORY_QOS + 6 + + + + + + + + TRANSIENT_LOCAL_DURABILITY_QOS + + + KEEP_LAST_HISTORY_QOS + 1 + + + + + TRANSIENT_LOCAL_DURABILITY_QOS + + + KEEP_LAST_HISTORY_QOS + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + KEEP_LAST_HISTORY_QOS + 1 + + + 512 + 4 + 128 + 128 + 512 + 380 + + + + 32 + + 0 + 500000000 + + 8 + true + + + + + + + + + + + + + + + KEEP_LAST_HISTORY_QOS + 10 + + + + + KEEP_LAST_HISTORY_QOS + 100 + + + + + + + + + + + + + + + + + + + KEEP_LAST_HISTORY_QOS + 1000 + + + + + KEEP_LAST_HISTORY_QOS + 200 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXCLUSIVE_OWNERSHIP_QOS + + + 100 + + + + + EXCLUSIVE_OWNERSHIP_QOS + + + + + + + + + 50 + + + + + + + + + + + + + + + + 1000 + + + + + + + + 1000 + + + + + + + + + + + + + + + + + + + dds.flow_controller.token_bucket.MeshFlowController + + + KEEP_LAST_HISTORY_QOS + 1 + + + 32 + 32 + 1 + 1 + 32 + + + + + 4096 + + + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 10 + 0 + + + + + + + 10 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 10 + 0 + + + + + + + 10 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + KEEP_LAST_HISTORY_QOS + 5 + + + + + KEEP_LAST_HISTORY_QOS + 5 + + + + + + + + + + + + + + + + + + + + + + + + 7400 + 250 + 2 + 0 + 10 + 1 + 11 + + + + + 30000 + 64 + 2048 + + + + UDPv4 | SHMEM + + + Monitoring UI Application + + + 65530 + + + + + 100 + 0 + + + 10 + 0 + + LIVELINESS_BASED_REMOTE_PARTICIPANT_PURGE + + 10 + 0 + + 1 + + 2 + 0 + + + 2 + 0 + + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 100000000 + + + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 100000000 + + + + 0 + 1 + + 5 + 0 + + + 0 + 200000000 + + + 0 + 200000000 + + 1000 + 8 + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + 65530 + + + 0 + 1 + + 5 + 0 + + + 0 + 200000000 + + + 0 + 200000000 + + 1000 + 8 + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + 65530 + + + + + + + dds.transport.UDPv4.builtin.recv_socket_buffer_size + 1048576 + + + + dds.transport.UDPv4.builtin.parent.message_size_max + 65530 + + + dds.transport.UDPv4.builtin.send_socket_buffer_size + 65530 + + + + + dds.transport.shmem.builtin.parent.message_size_max + 65530 + + + dds.transport.shmem.builtin.receive_buffer_size + 65530 + + + dds.transport.shmem.builtin.received_message_count_max + 32 + + + + + + + + + + + + + + + + TRANSIENT_LOCAL_DURABILITY_QOS + + + + RELIABLE_RELIABILITY_QOS + + + + KEEP_LAST_HISTORY_QOS + 1 + + + + + + + + + BEST_EFFORT_RELIABILITY_QOS + + + KEEP_LAST_HISTORY_QOS + 2 + + + + + + TRANSIENT_LOCAL_DURABILITY_QOS + + + + RELIABLE_RELIABILITY_QOS + + + + KEEP_LAST_HISTORY_QOS + 1 + + + + + + + KEEP_LAST_HISTORY_QOS + 10 + + + + + + + KEEP_LAST_HISTORY_QOS + 10 + + + + + diff --git a/astrobee/config/communications/ground_dds_ros_bridge.config b/astrobee/config/communications/ground_dds_ros_bridge.config index ba95d421ad..0bcd8df1d2 100644 --- a/astrobee/config/communications/ground_dds_ros_bridge.config +++ b/astrobee/config/communications/ground_dds_ros_bridge.config @@ -25,7 +25,7 @@ -- Robot we are receiving data from connecting_robot = "Bumble" --- Domain id, needs to be 23 for space +-- Domain id domain_id = 37 -- If the namespace needs to be the connecting robot name, please set to true diff --git a/communications/ground_dds_ros_bridge/readme.md b/communications/ground_dds_ros_bridge/readme.md index 41beb47821..06f3bd6772 100644 --- a/communications/ground_dds_ros_bridge/readme.md +++ b/communications/ground_dds_ros_bridge/readme.md @@ -1,39 +1,57 @@ \page ground_dds_ros_bridge Ground DDS ROS Bridge -The ground DDS ROS bridge acts like a translator between DDS and ROS. It listensto DDS telemetry coming from the robot and converts it to ROS messages. +The purpose of the ground DDS ROS bridge is to allow guest scientists to use +ros tools on the robot data coming from space. In order to do this, it listens +to DDS telemetry coming from the robot and converts it to ROS messages. Currently it only supports converting the access control state, guest science data, dock camera compressed image, navigation camera compressed image, science -camera compressed image, and the robot position messages. It also converts -messages published on the ros command topic to a dds command and publishes them -on the dds command topic. Please note that as of now, the ground dds ros bridge -can only connect to one robot. +camera compressed image, and the robot position messages. + +It also allows guest scientists to command the robot by converting messages +published on the ros command topic to a dds command message and publishes them +on the dds command message topic. Please see the "Commanding the Robot" section +on how to use this feature. + +Please note that as of now, the ground dds ros bridge can only connect to one +robot. The ground bridge will need to be configured for your specific situation. Please see the next section for more information. # Configuration +## Configuring the DDS Specific File + +DDS will need the ip address of the relay server that is broadcasting the data +from the space robots. Please ask your Astrobee point of contact for this ip +address. Once you have it, open the NDDS discovery peers file found here: + + $ASTROBEE_WS/src/astrobee/config/communications/dds_ground_bridge/NDDS_DISCOVERY_PEERS + +Please add the ip address to the end of the discovery peers file and end the +line with a semicolon. NOTE any line added to this file must end in a semicolon. + +## Configuring the Ground Bridge Node + The ground dds ros bridge config file can be found here: $ASTROBEE_WS/src/astrobee/config/communications/ground_dds_ros_bridge.config The following sections explain what may need to be changed in the file. -## Connecting Robot +### Connecting Robot The ground bridge needs to know the name of the robot you want to connect to. The default is Bumble. If you need to change this, please open the config file -and find the connecting_robot variable. Please change it to the name of the -robot you wish to connect to. Make sure to capitalize the first letter of the -name. +and find the connecting_robot variable. Change it to the name of the robot you +wish to connect to. Make sure to capitalize the first letter of the name. -## Domain id +### Domain id -The domain id for simulation is 37 and this is default value. If you need the -space domain id for use during an activity, please ask your Astrobee point of -contactor. +The default value for the domain id is 37 which is the domian id for the +simulation. Please ask your Astrobee point of contact for the space domain id. -## Namespace +### Namespace If you are running the ground bridge in simulation, you will probably want to use the namespace feature. When set to true, the ground bridge will publish @@ -44,8 +62,26 @@ is set to false. # Running the Ground DDS ROS Bridge -The ground bridge is not run by default in simulation. To run it, you'll need to -set the ASTROBEE_CONFIG_DIR environment variable. In a terminal with the -astrobee setup sourced, run: +To run the ground bridge, you'll need to set the ASTROBEE_CONFIG_DIR environment +variable. In a terminal with the astrobee setup sourced, run: + +ASTROBEE_CONFIG_DIR=$ASTROBEE_WS/src/astrobee/config/ roslaunch ground_dds_ros_bridge ground_dds_ros_bridge.launch + +# Commanding the Robot + +In order to command Astrobee from the ground, you must grab control of the +robot. Grabbing control of an Astrobee is done in a handshake like manor. First, +you request control, Astrobee sends a cookie, and then you use that cookie to +grab control. You can do this either using ros command line tools or creating +a ros node to do it. The steps are listen to the access control state, issue the +request control command, extract the cookie out of the access control state, and +then send the grab control command with the cookie as an argument in the +command. IMPORTANT, Astrobee uses the command source portion of the command to +determine who has control. Be sure to set the command source to the same thing +every time you issue a command or the robot may reject your command. It is also +helpful to set it to a distinguishing name so that it is clear who is commanding +the robot. For instance, ISAAC used "ISAACGroundSystem" as the command source. +The ISAAC team created a node that grabs control of the robot and issues +commands. If you would like to use it as an example, please see: -ASTROBEE_CONFIG_DIR=$ASTROBEE_WS/src/astrobee/config/ rosrun ground_dds_ros_bridge ground_dds_ros_bridge_node +https://github.com/nasa/isaac/blob/master/communications/ros_gs_bridge/src/ros_gs_bridge.cc diff --git a/communications/ground_dds_ros_bridge/src/ground_dds_ros_bridge.cc b/communications/ground_dds_ros_bridge/src/ground_dds_ros_bridge.cc index 66948ae95d..caa824b72e 100644 --- a/communications/ground_dds_ros_bridge/src/ground_dds_ros_bridge.cc +++ b/communications/ground_dds_ros_bridge/src/ground_dds_ros_bridge.cc @@ -55,7 +55,7 @@ namespace ground_dds_ros_bridge { GroundDdsRosBridge::GroundDdsRosBridge() { components_ = 0; - agent_name_ = "ISAAC Ground Bridge"; + agent_name_ = "Ground Bridge"; connecting_robot_ = ""; } @@ -204,7 +204,7 @@ bool GroundDdsRosBridge::Initialize(ros::NodeHandle *nh) { // Make path to QOS and NDDS files std::string config_path = ff_common::GetConfigDir(); - config_path += "/communications/dds/"; + config_path += "/communications/dds_ground_bridge/"; // Create fake argv containing only the particaptant name // Participant name needs to unique so combine bridge name with timestamp