-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a0ee352
commit 1ccafa4
Showing
8 changed files
with
98 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
demo_bridge_pub: | ||
ros__parameters: | ||
pub1: | ||
topic: "hi" | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import os | ||
|
||
from ament_index_python.packages import get_package_share_directory | ||
from launch.actions import SetEnvironmentVariable | ||
from launch.launch_description import LaunchDescription | ||
from launch_ros.actions import Node | ||
|
||
|
||
def generate_launch_description() -> LaunchDescription: | ||
""" | ||
Generate LaunchDescription for MQTT ROS bridge. | ||
Returns | ||
------- | ||
LaunchDescription | ||
Launches bridge_node. | ||
""" | ||
|
||
config = os.path.join( | ||
get_package_share_directory('mqtt_ros_bridge'), | ||
'config', | ||
'pub.yaml' | ||
) | ||
|
||
run_bridge_node = Node( | ||
package='mqtt_ros_bridge', | ||
executable='bridge_node', | ||
name='demo_bridge_pub', | ||
emulate_tty=True, | ||
output='screen', | ||
parameters=[config] | ||
) | ||
|
||
return LaunchDescription([ | ||
SetEnvironmentVariable("ROS_DOMAIN_ID", "2"), | ||
run_bridge_node | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from launch.actions import SetEnvironmentVariable | ||
from launch.launch_description import LaunchDescription | ||
from launch_ros.actions import Node | ||
|
||
|
||
def generate_launch_description() -> LaunchDescription: | ||
""" | ||
Generate LaunchDescription for MQTT ROS bridge. | ||
Returns | ||
------- | ||
LaunchDescription | ||
Launches bridge_node. | ||
""" | ||
run_bridge_node = Node( | ||
package='mqtt_ros_bridge', | ||
executable='bridge_node', | ||
emulate_tty=True, | ||
output='screen' | ||
) | ||
|
||
return LaunchDescription([ | ||
SetEnvironmentVariable("ROS_DOMAIN_ID", "1"), | ||
run_bridge_node | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from importlib import import_module | ||
|
||
from mqtt_ros_bridge.msg_typing import MsgLike | ||
|
||
|
||
def lookup_object(object_path: str, package: str = 'mqtt_ros_bridge') -> type[MsgLike]: | ||
""" lookup object from a some.module:object_name specification. """ | ||
module_name, obj_name = object_path.split(":") | ||
module = import_module(module_name, package) | ||
obj = getattr(module, obj_name) | ||
return obj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters