-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Rework ros2 support #7229
Rework ros2 support #7229
Conversation
Ensure that actually only the unreal sysroot is deployed for all C as well C++ compilations including dependencies. That ensures the server is NOT anymore linked against the system glibc (which is in Ubuntu22.04 incompatible with the Unreal one). Harmonized naming split into client/server (instead of libcpp and libstdcpp) to ensure nothing mixed up (and there were things mixed up before!) Refactor C# Unreal build using CarlaRules base class to provide common functionality. Fixing windows build without ROS2 and added intitial windows build with ROS2 Minors: - Update osm2odr commit - Fix windows install scripts and forward arguments for building libcarla - Add some helper scripts to run under Linux
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would update our CHANGELOG.md based on your changes. |
I've created a basic PowerPoint describing a bit what is implemented... |
…ros2_against_unreal_dependencies
DataTypes: Introduced geom::AngularVelocity, geom::Velocity,geom::Acceleration, geom::Quaternion to make the Unreal -> Carla -> ROS2 data conversion more clear. Also in preparation of the Carla -> ROS2 data conversion afterwards. Added some Math functions for Quaternions. BUGFIX: Fixed geom::Rotation::RotateVector() rotation directions of pitch and roll! Added RightHandedVector3D.h (temporary internal class) Commented TransformationMatrix access out by ifdef to prevent from erroneous misuse RPC: Extended Control types by timestamp. Client: Applied geom::AngularVelocity, geom::Velocity, geom::Acceleration to Actor functions Added Vehicle::GetAckermanControl() detail/Episode,Simulator: Fixed compiler warnings on std::move Actor: Moved Blueprint handling sources to carla/actor from carla/client to be able to make use of that functionalilty within server when ROS2 is activated. Streaming: Moved streaming/detail/tcp/Message.h -> streaming/detail/Message.h to be deployed for non-tcp communication streams like ROS2. Moved general (tcp-independent parts) from tcp/ServerSession to streaming/detail/Session.h to be used for ROS2 streams. Had to rename a Write() function to WriteMessage because of virtual function overloaded with template function not possible. Make Dispatcher a shared_pointer to be able to access from ROS2. Removed EnableForROS calls, as the decision to use ROS or not is done via configuration. The topics are always crecated whenever the sensors are spawned and data-stream sessions are opened/attached on demanded; i.e. a ROS2 participant is subscribing to the topic. Serializer: Provide GetHeaderOffset() functions where missing. Add sensor_relative_transform (Location and Quaternion parts) to SensorHeader to support relative TF. Keep it in the header also when not compiled with ROS2 to keep ROS enabled server builds compatible with non-ROS enabled client builds as it's not that much of an overhead. Add SerializerVectorAllocator to provide the SharedBufferView data 'under the hood' as vector without data copy. Remove move semantic from Deserialize on server builds to allow multiple sinks (i.e. TCP-Server and ROS2 to deserialize the data without destoying it). Added VehicleAckermannControl to ActorDynamicState in form of a union with VehicleControl to save space Extract sensor/data/Array.h into a ArrayConst.h base class to be used for const data acess on ROS2 Deserialization of RawEpisodeState. UE4: Updated accordingly. ROS2: Filled the most of the ROS2 interfaces. Removed some compiler warnings TODO: Testing of control interfaces; Testing of sensor data values; Find out why the services are not visible in ROS2
instead of deleting the file
a57cf4a
to
cac1560
Compare
- fix actor name definion to_string() function - fix ROS2NameRegistry
I got it compiled and linked under windows now; had to rename actor -> actors as windows file system is ... after that long time still not able to distiguish between LARGE letters and small letters ... incredible. I also cannot test if ROS2 works on windows... because I had to find out that: oh windows 11 is not supported by ROS2, yet. Theoretically, it should work though given that not some firewall stuff is interfering with the ports required by ROS2/DDS. But crashing when starting up on creating DdsDomainParticipantImpl() with access violation is pointing so some stuff like that. Maybe we should leave the debugging of this under Windows to someone who actually needs that there and has experience with DDS/ROS under Windows. |
Maybe some comment here on what's actually missing on this now is mainly:
|
Make all unit vectors safe.
after created PR to dev branch there
…ros2_against_unreal_dependencies
… into berndgassmann/rework_ros2_support
Hey Bernd, We are sorry from being late on your PR. We really like your PR and we think it takes very interesting things about ROS2 functionality, but we think we need to focus the PR on ROS2. We are aware that you have introduced quite useful functionality in CARLA, but in order to be tested properly. In order to provide better feedback, first we would like to focus on ROS2 to test it and then after the merge of ROS2 on the introduction of new classes or other stuff. This other functionality could go into another PR so we can test it properly too. Would be possible to have a PR focused in ROS2? Apart from that we had some questions and comments about your code; Questions:
Comments:
Kind regards;, CARLA team |
Hi CARLA team, indeed this is focussing mainly required ROS2 changes. Let's see what is obsolete and can be moved out.
Then on the ROS2 changes:
In summary: You might want to look into the general server build fixes (#7151) that the carla-server and the libraries built for the server are compiled against the Unreal-Sysroot and don't use ANYTHING from the host (maybe someone has to adapt the same for the pytorch build afterwards to make that also clean). If that one is merged we can rebase this commit (or merge the dev branch into this one) to get rid of the general build system changes. |
Separate installation of clang/llvm in Ubuntu is not required anymore since the UE4-clang/llvm is used for compilation of ALL dependencies to ensure the exact required sysroot is used.
… into berndgassmann/rework_ros2_support
Since the Unreal sysroot build is broken and mixes up libraries from sysroot with libraries installed on the host, we have to enforce using the native clang compilation and suppress the sysroot usage completely. Still clang is using the bundled libc++. Try to fix also libtorch compilation using the server setup (don't know yet if that works).
If the configuration setting: ROS2TopicVisibility=False is set to false, actors and sensors not created via ROS interface are not published via ROS per default. But sensors can be explicitly enabled via EnableForROS calls on client side. This is a useful feature to support the leaderboard where not all information shall be published via ROS.
Fixed wrong cast on IMUData publisher leading to memory issues and finally segfaults. Fix some world sensor topics not under /carla/world Moved control topics under extra /control subname Fixed V2XEvent Deserializer constructors
Now every vehicle and every walker interface provides the possiblity to make the simulator stop at a certain point in time in case the controller requires more time than expected (or someone is debugging a controller e.g. in a breakpoint).
V2XCustom Sensor can be configured by the Actors role_name Attribute to create communication channels.
c3e54fd
to
58b9f48
Compare
58b9f48
to
49805b0
Compare
and get rid of -ForceUseSystemCompiler for server build
- no local clang installation required anymore
da1fcb9
to
50b3a8f
Compare
92f3035
to
d2b59ed
Compare
- remove duplicated 'world' in service names - fix Segfault in SpawnObject calls of std::sample() - disable synchronization on generate_traffic since it's not working properly anymore...
This PR is replaced by a step-wise (stacked) approach: |
Description
Fixes #
Where has this been tested?
Possible Drawbacks
This change is