How to add two ego cars?
JianXinyu opened this issue · comments
Xinyu Jian commented
Is it possible to show another car using the same car model as the ego car? I'd like to show a shadow-ego car as the historical trajectory.
Timothy Wojtaszek commented
@JianXinyu One way we approached this was simply to define a pose, such as /ghost_pose
, but then we added them directly as a customLayer
to the LogViewer props.
Xinyu Jian commented
@twojtasz Thanks for your answer! I'll test both methods in my project.
daybreak commented
const customLayers = [
new SimpleMeshLayer({
id: 'shadow-ego',
opacity: 0.5,
coordinateSystem: COORDINATE_SYSTEM.METER_OFFSETS,
coordinateOrigin: matrix?.origin || CAR.origin,
// Adjust for car center position relative to GPS/IMU
getTransformMatrix: d =>
matrix?.vehicleRelativeTransform
?.clone()
?.translate(origin)
?.scale(scale),
mesh,
data: CAR_DATA,
pickable: true,
getPosition: d => d,
getColor: [245, 34, 45],
wireframe: false,
updateTriggers: {
getTransformMatrix: matrix?.vehicleRelativeTransform
},
})
]
Timothy Wojtaszek commented
considering this has been answered, I'm going to close this issue. Please re-open or file a new issue.