How to send routing request to apollo through code ? #90
-
Hi Team, I am working on a project, and I want to send routing request through code instead of Dreamview UI. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
hi,this question about apollo,I found a requirement similar to what you mentioned under the Apollo project, and you can refer to this issue: I hope it can help you, of course, you can also share any experience here |
Beta Was this translation helpful? Give feedback.
-
You can do like this: routing_request = routing_pb2.RoutingRequest() start_apollo_waypoint = routing_request.waypoint.add() target_apollo_waypoint = routing_request.waypoint.add() self.routing_request_writer.write(routing_request) |
Beta Was this translation helpful? Give feedback.
You can do like this:
`
self.routing_request_writer = self.node.create_writer('/apollo/routing_request',
routing_pb2.RoutingRequest)
routing_request = routing_pb2.RoutingRequest()
routing_request.header.timestamp_sec = now_cyber_time
routing_request.header.module_name = 'xxx'
start_apollo_waypoint = routing_request.waypoint.add()
start_apollo_waypoint.pose.x = start_location.x
start_apollo_waypoint.pose.y = start_location.y
target_apollo_waypoint = routing_request.waypoint.add()
target_apollo_waypoint.pose.x = target_location.x
target_apollo_waypoint.pose.y = target_location.y
self.routing_request_writer.write(routing_request)
`