Skip to content

Commit

Permalink
fix(default_ad_api): fix adapi web server creates two nodes (autoware…
Browse files Browse the repository at this point in the history
…foundation#2404)

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>
  • Loading branch information
isamu-takagi authored Nov 30, 2022
1 parent a790489 commit 08f5eaf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions system/default_ad_api/launch/default_ad_api.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def generate_launch_description():
composable_node_descriptions=components,
)
web_server = Node(
namespace="default_ad_api",
package="default_ad_api",
name="web_server",
executable="web_server.py",
Expand Down
4 changes: 2 additions & 2 deletions system/default_ad_api/script/web_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ def convert_dict(msg):

def spin_ros_node():
global cli
rclpy.init(args=sys.argv)
node = Node("ad_api_default_web_server")
cli = create_service(node, InterfaceVersion, "/api/interface/version")
rclpy.spin(node)


if __name__ == "__main__":
rclpy.init(args=sys.argv, signal_handler_options=rclpy.signals.SignalHandlerOptions.NO)
thread = Thread(target=spin_ros_node)
thread.start()
app.run(host="localhost", port=8888, debug=True)
app.run(host="localhost", port=8888, debug=False)
rclpy.shutdown()
thread.join()

0 comments on commit 08f5eaf

Please sign in to comment.