ouvrir un fichier :
carla_ros_bridge/src/carla_ros_bridge/actor_factory.py
Ajoutez la fonction dans class ActorFactory(object):
:
def set_spectator(self, world, actor, height):
spectator = world.get_spectator()
transform = actor.get_transform()
spectator.set_transform(
carla.Transform(
transform.location + carla.Location(z=height),
carla.Rotation(pitch=-90),
)
)
Ajouter à update_available_objects(self):
la fin de la fonction :
actors = self.world.get_actors()
actor = actors.filter('*imu*')
if len(actor) != 0:
self.set_spectator(self.world, actor[0], height=self.camera_height)
ouvrir un fichier :
carla_ros_bridge/src/carla_ros_bridge/bridge.py
Ajout d'une propriété camera_height à la classe CarlaRosBridge. peut être sur la ligne 430
carla_bridge = CarlaRosBridge(camera_height=300)
Le paramètre de hauteur est transmis.