examples.custom_msgs package

Submodules

examples.custom_msgs.ros2_message_example module

A message publisher and listener for ROS 2 messages using Wrapyfi.

This script demonstrates the capability to transmit ROS 2 messages, specifically geometry_msgs/Pose and std_msgs/String, using the MiddlewareCommunicator within the Wrapyfi library. The communication follows the PUB/SUB pattern allowing message publishing and listening functionalities between processes or machines.

Demonstrations:
  • Using the ROS 2 message

  • Transmitting std_msgs/String and geometry_msgs/Pose ROS 2 messages

  • Applying the PUB/SUB pattern with channeling and mirroring

Requirements:
  • Wrapyfi: Middleware communication wrapper (refer to the Wrapyfi documentation for installation instructions)

  • ROS 2, rclpy: Used for handling and creating ROS 2 messages (refer to the Wrapyfi documentation for installation instructions)

Ensure ROS 2 is installed and the required message types are available.

Run:
# On machine 1 (or process 1): Publisher waits for keyboard input and transmits message

python3 ros2_message_example.py --mode publish

# On machine 2 (or process 2): Listener waits for message and prints the received ROS 2 messages

python3 ros2_message_example.py --mode listen

class examples.custom_msgs.ros2_message_example.Notifier[source]

Bases: MiddlewareCommunicator

send_message()[source]

Exchange ROS 2 messages over ROS 2.

examples.custom_msgs.ros2_message_example.parse_args()[source]

Parse command line arguments.

examples.custom_msgs.ros2_message_example.main(args)[source]

Main function to initiate Notify class and communication.

examples.custom_msgs.ros_message_example module

A message publisher and listener for ROS messages using Wrapyfi.

This script demonstrates the capability to transmit ROS messages, specifically geometry_msgs/Pose and std_msgs/String, using the MiddlewareCommunicator within the Wrapyfi library. The communication follows the PUB/SUB pattern allowing message publishing and listening functionalities between processes or machines.

Demonstrations:
  • Using the ROS message

  • Transmitting std_msgs/String and geometry_msgs/Pose ROS messages

  • Applying the PUB/SUB pattern with channeling and mirroring

Requirements:
  • Wrapyfi: Middleware communication wrapper (refer to the Wrapyfi documentation for installation instructions)

  • ROS, ROSPy: Used for handling and creating ROS messages (refer to the Wrapyfi documentation for installation instructions)

Ensure ROS is installed and the required message types are available.

Run:
# On machine 1 (or process 1): Publisher waits for keyboard input and transmits message

python3 ros_message_example.py --mode publish

# On machine 2 (or process 2): Listener waits for message and prints the received ROS messages

python3 ros_message_example.py --mode listen

class examples.custom_msgs.ros_message_example.Notifier[source]

Bases: MiddlewareCommunicator

send_message()[source]

Exchange ROS messages over ROS.

examples.custom_msgs.ros_message_example.parse_args()[source]

Parse command line arguments.

examples.custom_msgs.ros_message_example.main(args)[source]

Main function to initiate Notify class and communication.

examples.custom_msgs.ros_parameter_example module

A message publisher and listener for ROS properties using Wrapyfi.

This script demonstrates the capability to transmit ROS properties, specifically using the Properties message, using the MiddlewareCommunicator within the Wrapyfi library. The communication follows the PUB/SUB pattern allowing property publishing and listening functionalities between processes or machines.

Demonstrations:
  • Using the Properties message

  • Transmitting various data types as properties, such as strings, dictionaries, and non-persistent properties

  • Applying the PUB/SUB pattern with channeling and mirroring

Requirements:
  • Wrapyfi: Middleware communication wrapper (refer to the Wrapyfi documentation for installation instructions)

  • ROS, ROSPy: Used for handling and creating ROS properties (refer to the Wrapyfi documentation for installation instructions)

Ensure ROS is installed and the required message types are available.

Run:
# On machine 1 (or process 1): Publisher waits for keyboard input and transmits properties

python3 ros_parameter_example.py --mode publish

# On machine 2 (or process 2): Listener waits for properties and prints the received properties

python3 ros_parameter_example.py --mode listen

class examples.custom_msgs.ros_parameter_example.Notifier[source]

Bases: MiddlewareCommunicator

set_property()[source]

Exchange ROS properties over ROS.

examples.custom_msgs.ros_parameter_example.parse_args()[source]

Parse command line arguments.

examples.custom_msgs.ros_parameter_example.main(args)[source]

Main function to initiate Notify class and communication.

Module contents