Skip to content

Commit

Permalink
lampi demo start
Browse files Browse the repository at this point in the history
  • Loading branch information
InvincibleRMC committed Apr 30, 2024
1 parent cefac0a commit c47e70e
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 30 deletions.
6 changes: 6 additions & 0 deletions config/lampi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
mqtt_ros_bridge:
ros__parameters:
lampi:
topic: "/devices/b827eb3d9134/lamp/set_config"
type: "lampi_msgs.msg:Lampi"
publish_on_ros: False
24 changes: 0 additions & 24 deletions launch/bridge_launch.py

This file was deleted.

28 changes: 27 additions & 1 deletion launch/demo_turtle_sim_launch.py → launch/demo_pub_launch.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
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
Expand All @@ -13,14 +16,37 @@ def generate_launch_description() -> 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',
emulate_tty=True,
output='screen',
arguments=[config]
)

turtle_sim = Node(
package='turtlesim',
executable='turtlesim_node',
emulate_tty=True,
output='screen'
)

rqt = Node(
package='rqt_gui',
executable='rqt_gui',
emulate_tty=True,
output='screen'
)

return LaunchDescription([
SetEnvironmentVariable("ROS_DOMAIN_ID", "2"),
turtle_sim
run_bridge_node,
turtle_sim,
rqt
])
10 changes: 9 additions & 1 deletion launch/demo_sub_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,16 @@ def generate_launch_description() -> LaunchDescription:
output='screen'
)

rqt = Node(
package='rqt_gui',
executable='rqt_gui',
emulate_tty=True,
output='screen'
)

return LaunchDescription([
SetEnvironmentVariable("ROS_DOMAIN_ID", "1"),
run_bridge_node,
turtle_sim
turtle_sim,
rqt
])
15 changes: 11 additions & 4 deletions launch/demo_pub_bridge_launch.py → launch/lampi_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ def generate_launch_description() -> LaunchDescription:
config = os.path.join(
get_package_share_directory('mqtt_ros_bridge'),
'config',
'pub.yaml'
)
'lampi.yaml'
)

run_bridge_node = Node(
package='mqtt_ros_bridge',
Expand All @@ -30,7 +30,14 @@ def generate_launch_description() -> LaunchDescription:
arguments=[config]
)

rqt = Node(
package='rqt_gui',
executable='rqt_gui',
emulate_tty=True,
output='screen'
)

return LaunchDescription([
SetEnvironmentVariable("ROS_DOMAIN_ID", "2"),
run_bridge_node
run_bridge_node,
rqt
])

0 comments on commit c47e70e

Please sign in to comment.