Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor ROS2 support #2

Open
wants to merge 30 commits into
base: berndgassmann/rework_ros2_step_2_prepare_libcarla
Choose a base branch
from

Conversation

berndgassmann
Copy link
Owner

ROS2:

  • Make use of base classes to remove duplicated code
  • ros2 UEPublisher classes for sensors access directly the data stream already prepared for the TCP-Clients
  • Introduced additional publishers for traffic-signs/lights/v2xsensor/actor_list, etc.
  • Introduced a basic set of ros2 service calls to control Carla

CarlaServer uses rpc::RpcServerInterface to communicate with TCP-Clients as well with the (integrated) DDS-Client

EnableForRos:

  • Dynamic switching on ROS visibility is possible for all actors now
  • Default startup behavior is selectable by ROS2TopicVisibility parameter in DefaultGame.ini: If true, then all and every topic that is currently offered by the implementation is visible from the beginning. If false, then only the sensors/actors created via the Client- or ROS-Interface are visible by defaults. Others can be activated via EnableForRos() calls

Introduced fine grained ServerSynchronization mechanism, where each client has the possibility to interact with the synchronization of the carla-server on their own. Especially the ROS interface provides means of a time window, the server is allowed to run. Like this, every client can prevent the carla-server to run too fast depending on their individual speed.
There is no sync-master anymore. Every client decides for its own if it requires synchronization or not.
Drawback of this change: some existing code might have to be changed (see removal of synchronous_master in generate_traffic.py).

Description

Fixes #

Where has this been tested?

  • Platform(s): ...
  • Python version(s): ...
  • Unreal Engine version(s): ...

Possible Drawbacks

Drawback of this change: some existing code might have to be changed (see removal of synchronous_master in generate_traffic.py). But in the end it is getting much easier to work with multiple synchronization clients.
Also noted in the Changelog.

ROS2:
- Make use of base classes to remove duplicated code
- ros2 UEPublisher classes for sensors access directly the data stream
already prepared for the TCP-Clients
- Introduced additional publishers for
traffic-signs/lights/v2xsensor/actor_list, etc.
- Introduced a basic set of ros2 service calls to control Carla

CarlaServer uses rpc::RpcServerInterface to communicate with TCP-Clients
as well with the (integrated) DDS-Client

EnableForRos:
- Dynamic switching on ROS visibility is possible for all actors now
- Default startup behavior is selectable by ROS2TopicVisibility
parameter in DefaultGame.ini: If true, then all and every topic that is
currently offered by the implementation is visible from the beginning.
If false, then only the sensors/actors created via the Client- or
ROS-Interface are visible by defaults. Others can be activated via
EnableForRos() calls

Introduced fine grained ServerSynchronization mechanism, where each
client has the possibility to interact with the synchronization of the
carla-server on their own. Especially the ROS interface provides means
of a time window, the server is allowed to run. Like this, every client
can prevent the carla-server to run too fast depending on their
individual speed.
There is no sync-master anymore. Every client decides for its own if it
requires synchronization or not.
Drawback of this change: some existing code might have to be changed
(see removal of synchronous_master in generate_traffic.py).
and adapt SpawnObject() with blueprint msg data type
and adapt spawn_object_service response to old error behavior in
returning -1.
the frame_id's must not start with "\"
And fix LoadMapService response
…sPublisher

Adapt SynchronizationWindow naming to allow interpretation of
CarlaSynchronizationWindowParticipantState content.
Fix sychronization mechanism.
CarlaActorListPublisher publishes transient local since the updates are
not regular.
Ensured that Objects publishers also publish empty object lists if there
are no objects at all.
This provides the pseudo.speedometer and pseudo.odom sensors for better
backward compatibility and usability.
Such information was missing since ever in CARLA interface to the
outside.
... because reuse of role name for that purpose is not a good idea.
@berndgassmann berndgassmann force-pushed the berndgassmann/rework_ros2_step_3_refactor_ros2_support branch from ac49792 to 2aa0a6c Compare August 6, 2024 08:18
- qos history kind eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS
- qos reliablility kind eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS
- qos durability kind
eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS
for reader, writer, topic
@berndgassmann berndgassmann force-pushed the berndgassmann/rework_ros2_step_3_refactor_ros2_support branch from 2aa0a6c to 77b13d8 Compare August 6, 2024 08:41
.. that it happes AFTER the sensor data was processed.
... instead of std::string to support binary data blobs.
V2X:
- *V2XSensor: Using the actor object of the sensor itself to ensure the
position offset of the sensor is used instead of some magical fixed
vehicle height offset AND to allow sensors without an owner if these are
palced within the infrastructure (V2I communication) as not every sensor
will be attached to a vehicle!
- Fix the ordering of V2X sensor actions in conjunction with ROS2 to
allow clearing of the messages at the right point in time.
- Fix UeV2XCustomSubscriber: take every message instead of every second

SpawnObjectService: up to 5 retries on spawning of vehicles at random
positions before giving up
... and fix endless loop in ROS2NameRegistry...
and remove not required vehicle and walker sync_subscriber, because
every connecting publisher is treated independen at
/carla/world/control/synchronization_window
… berndgassmann/rework_ros2_step_3_refactor_ros2_support
including enabling V2X Sensor within infrastructure without other actor
required.
and make sensor publisher reliable by default to support more compatible
reliable transport
…_prepare_libcarla' into berndgassmann/rework_ros2_step_3_refactor_ros2_support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant