Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/carla carma state integration #49

Merged
merged 26 commits into from
Mar 16, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,18 @@ def check_plugin_status(plugin_msg):
plugins_activated = True
chengyuan0124 marked this conversation as resolved.
Show resolved Hide resolved

def initialize():
rospy.init_node("carma_carla_guidance")
service = rospy.ServiceProxy('/set_active_guidance')
chengyuan0124 marked this conversation as resolved.
Show resolved Hide resolved
route_sub = rospy.Subscriber("/route_event",RouteEvent(), check_route_status)
plugin_sub = rospy.Subscriber("/plugin_discovery", Plugin(), check_plugin_status)
if route_selected == True:
if plugins_activated == True:
service.call()
else:
rospy.spin()
#While-loop monitors the route and plugin status and sets guidance to active once both are confirmed true
while rospy.is_shutdown() != True:
route_sub = rospy.Subscriber("/route_event",RouteEvent(), check_route_status)
plugin_sub = rospy.Subscriber("/plugin_discovery", Plugin(), check_plugin_status)
chengyuan0124 marked this conversation as resolved.
Show resolved Hide resolved
if route_selected == True:
chengyuan0124 marked this conversation as resolved.
Show resolved Hide resolved
if plugins_activated == True:
service.call(True) #Sets guidance status to active
chengyuan0124 marked this conversation as resolved.
Show resolved Hide resolved
break

rospy.spin()
chengyuan0124 marked this conversation as resolved.
Show resolved Hide resolved

if __name__ == '__main__':
print("carma_carla_guidance")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def check_plugin_registration(plugin):


def initialize():
rospy.init_node("carma_carla_plugins")
registered_plugins_serv = rospy.ServiceProxy('/get_registered_plugins')
plugin_list.plugins = registered_plugins_serv.call()
plugin_sub = rospy.Subscriber('/plugin_discovery',Plugin(), plugin_status_cb)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def check_selected_route(available_routes):
return selected_route

def initialize():
rospy.init_node("carma_carla_route")
route_event_sub = rospy.Subscriber('/guidance/route_event', RouteEvent,route_event_callback)
available_routes = get_available_routes()

Expand Down