Closed atinfinity closed 4 years ago
That's intended behavior. See in code: Initially the first spawn_point is used.
@fpasch Thank you for your reply.
See in code: Initially the first spawn_point is used.
In this case, start and goal are same position. So, I think that carla_waypoint_publisher should not generate many waypoints.
Currently carla_waypoint_publisher add offset to calculate a route from the current location to goal. Is there the reason for this offset? https://github.com/carla-simulator/ros-bridge/blob/28d4ef607e07d217b873e35aee768d0a11b1bfa5/carla_waypoint_publisher/src/carla_waypoint_publisher/carla_waypoint_publisher.py#L77
I made simple validation code.
import carla
from agents.navigation.global_route_planner import GlobalRoutePlanner
from agents.navigation.global_route_planner_dao import GlobalRoutePlannerDAO
host = "127.0.0.1"
port = 2000
carla_client = carla.Client(host=host, port=port)
carla_client.set_timeout(2)
world = carla_client.get_world()
for actor in world.get_actors():
if actor.attributes.get('role_name') == 'ego_vehicle':
ego_vehicle = actor
break
location = ego_vehicle.get_location()
print(location)
map = world.get_map()
dao = GlobalRoutePlannerDAO(map)
grp = GlobalRoutePlanner(dao)
grp.setup()
z_offset = 2.0
start = location
end = carla.Location(location.x, location.y, location.z + z_offset)
route = grp.trace_route(start, end)
print("number of waypoint = {}".format(len(route)))
In this code, GlobalRoutePlanner generated 274 points(this value depends on current location and map). I changed z_offset
to zero, GlobalRoutePlanner generated 1 point.
As a result, I think that this is a problem how to set goal in carla_waypoint_publisher.
That offset was added because there were issues with spawning into the ground. That might be solved with newer CARLA versions.
Although you might be right, this is currently more a "feature" than a bug. Because for demo purposes, the car should start driving by default.
What exactly do you want to achieve? Maybe it would make sense the add the goal to the launch file. (Similar to the ego vehicle spawn point, that can be specified here.
System information (version)
Detailed description
I tried to use carla_waypoint_publisher. I think that carla_waypoint_publisher publish unintended waypoint. Is this intended behavier?
Case1
At first time, I don't set initial pose using RViz. But, carla_waypoint_publisher published waypoint.
Case2
I set initial pose and goal using RViz. But, carla_waypoint_publisher published unintended waypoint. (red line: Goal, green path: published waypoint)
Steps to reproduce
Case1
Case2
And,