Is it possible to make the "2D Dummy Car" drive along the map/lanes? #5206
-
Hi, Currently the "2D Dummy Car" can only drive in a pre-defined direction, but I'd like to check if it's possible to make it drive along the lanes by the map? I think it should be possible but of course with work to do, this is what I've thought: Create new simulator car as the "2D Dummy Car". In simple simulator module, the simulator car can drive in "auto" mode along with the map, if we can re-use the simulator as the dummy car, then the "2D Dummy Car" can drive by the lanes in the map. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Currently, if you want to have some complex vehicle maneuver, there is a tool called scenario simulator. Using the scenario editor, you can write scenarios where NPCs drive along a lane at specified timing. Does the tools satisfy your needs? |
Beta Was this translation helpful? Give feedback.
-
I found that how the dummy car moves is defined by the package of I managed to implement the feature but I don't think it will be merged, so I just share my code here if someone is interested: //save new stamp/pose back to object
object.header.stamp = current_time;
object.initial_state.pose_covariance.pose = object_info.pose_covariance_.pose;
//update the yaw of the object
lanelet::Lanelet closest_lanelet;
if (lanelet::utils::query::getClosestLaneletWithConstrains(
lanelet::utils::query::laneletLayer(lanelet_map_ptr_), object.initial_state.pose_covariance.pose, &closest_lanelet, 0.0)) {
const double lane_yaw = lanelet::utils::getLaneletAngle(closest_lanelet, object.initial_state.pose_covariance.pose.position);
object.initial_state.pose_covariance.pose.orientation = autoware::universe_utils::createQuaternionFromYaw(lane_yaw);
} The code above is not complete, but main functions like |
Beta Was this translation helpful? Give feedback.
Currently, if you want to have some complex vehicle maneuver, there is a tool called scenario simulator. Using the scenario editor, you can write scenarios where NPCs drive along a lane at specified timing.
Does the tools satisfy your needs?