weixin_39881760
weixin_39881760
2021-01-12 19:13

Modifying driving behaviour of Individual Non-player agents

I inted to modify driving behavior of individual non-player agents (by adding temporal noise).

I tried modifying the file WheeledVehicleAIController.cpp but it modifies the behavior of all non-player agents simultaneously.

How do I modify the driving commands that a single non-player agent receives from the AI?

该提问来源于开源项目:carla-simulator/carla

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

4条回答

  • weixin_39881760 weixin_39881760 4月前

    Hi ,

    Thanks for your reply. I am saving the address of individual possessed vehicle as a work around and attaching my controller to it. Can you please point me to the code which passes individual vehicles iteratively to the AI Controller?

    点赞 评论 复制链接分享
  • weixin_39540704 weixin_39540704 4月前

    -io The controller is spawned right after spawning the vehicle by the vehicle itself https://github.com/carla-simulator/carla/blob/957d44bb38ba1fb04041dd935cf3ac41f675121e/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/VehicleSpawnerBase.cpp#L104-L107

    点赞 评论 复制链接分享
  • weixin_39881760 weixin_39881760 4月前

    thank you!

    点赞 评论 复制链接分享
  • weixin_39540704 weixin_39540704 4月前

    Hi -io,

    Each vehicle gets its instance of AWheeledVehicleAIController, thus changes there affect all vehicles. Controllers "posses" the vehicle, so you can access your vehicle with GetPossessedVehicle(). In any case, you don't have enough info here to distinguish which car are you possessing.

    Probably the best would be to create your own controller, spawn a vehicle (not with VehicleSpawner), and attach your controller to it.

    点赞 评论 复制链接分享