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
base: dev
Are you sure you want to change the base?
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
Keep the client side unchanged for the moment. Server side extended to multi-client synchronization requests using time windows to support synchronization for ROS2 actor controller. In addition, fixed the issue that a ticking client keeps CARLA in synchronous mode when disconnecting by deploying the set_on_dis/connection() rpc server functionality. (Issue with RPC library providing sometimes a zero session id for some time) Added /carla/world/control topic functionality. Ensure ROS2 "server" is processing messages while waiting. Ensure topic names do not contain multiple successive '/'. Fixed some typos. Adapted some ROS2QoS settings. Keep ServerSynchonization debug messages for the time being.
Hey Bernd, can you answer my message on discord so we can have a chat about the PRs? |
- Allow ROS2-Server to process messages while waiting
…ros2_against_unreal_dependencies
- Move gcc-7 to gcc-13 since that's the default compiler on Ubuntu 24.4LTS. - Fix make clean - Fix make launch (without ROS2 args) - Fixed wrong syntax in Linux.mk - Fix missing ROS2 include when compiled without ROS - Remove Util/Running folder again - Remove LibCarla/.clang-format file
… into berndgassmann/rework_ros2_support Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorDispatcher.cpp Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorROS2Handler.cpp Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorROS2Handler.h Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/GnssSensor.cpp Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/InertialMeasurementUnit.cpp Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/ObstacleDetectionSensor.cpp Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/RayCastLidar.cpp Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/RayCastSemanticLidar.cpp
Introduced relevant variables talking on ROS2_MW_* within setup.sh/bat to get rid of explicit fastdss data in CMakeLists.txt. Added carla/ros2/fastdds folder and moved the fastdds impl files as well as the fastdds generated files for msg/srv there. The common code des not have to include/add any fastdds specifics. Remove msg/srv files from installed files.
…st_unreal_dependencies' into berndgassmann/rework_ros2_support
commit def46b8edc34e470caea445423add114eedf6585 Author: Bernd Gassmann <bernd.gassmann@intel.com> Date: Thu Apr 18 16:27:08 2024 +0200 Fix proj and asio build checkout the proj 7.2 branch with required compilation fixes on newer systems let asio only install the data instead of compiling the tests/examples which we don't want/need
…st_unreal_dependencies' into berndgassmann/rework_ros2_support Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/CollisionSensor.cpp
… into berndgassmann/rework_ros2_support
…os2_support Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.cpp
62a1016
to
51eff49
Compare
51eff49
to
d4195c9
Compare
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).
Description
Fixes #
Where has this been tested?
Possible Drawbacks