/clock Topic Not Published and Unreal Engine 5.7 Build Fix - #182
/clock Topic Not Published and Unreal Engine 5.7 Build Fix#182shandilya1998 wants to merge 2 commits into
/clock Topic Not Published and Unreal Engine 5.7 Build Fix#182Conversation
Problem ======= 1. Build failure due to linking issues with libc++abi 2. Requests from Project AirSim C++ client not reaching sim server 3. Timeout for failed requests not implemented on c++ client side causing further requests to be permanently blocked 4. Timestamps from airsim not passed to published messages by the c++ client Solution ======== 1. Need to explicitly add `-lc++abi` in link options to ensure build compatibility with Unreal Engine 5.7's v26 clang toollchain 2. Uninitialised `fis_canceled_` variable in `class TAsyncResultProviderBase` leads to garbage values in the variable which essentially cancels all incoming requests. `/LoadScene` coincidentlally works, however, none of the requests after scene is loaded work. Explicitly initialising `fis_canceled_` fixes the issue. File changed is `client/cpp/ProjectAirsimClientLib/src/AsyncResultInternal.h` 3. Added request cancellation and timeout instructions to process failed requests to sim server in `client/cpp/ProjectAirsimClientLib/src/Client.cpp` 4. Overloaded `MakeHeader` and updated its usage in `ros/projectairsim_ros2_cpp/src/projectairsim_ros2_cpp_node.cpp` to ensure timestamps from unreal engine are published with ROS2 messages Note ==== 1. Some formatting changes may have creeped in. Please ignore the same.
|
FYI #177 also fixes this! |
|
Thank you for your contribution @shandilya1998! Nice work and observations 🦾 I'll answer by topic. Please update the code + description of this PR accordingly. UE5.7 linking issueI think the linking issues was solved as part of #162. Try rebasing your branch and let me know if you still see the issue. C++ client requests not reaching sim serverAlready solved before this PR, at least for the claimed Failed request timeout blocks later requestsI tested it locally, and this PR definitely solves the issue. Nice! AirSim timestamps not passed to ROS2 messagesAlso fixed by this PR, nice work! |
|
Thanks @shandilya1998, the sensor headers should retain the simulator's timestamp. If /clock isn't being published, that's the only solution. Additionally, we should implement a topic on the server to publish the clock instead of using the GetSimTime service. |
Fixes: # 1. Build failure due to linking issues with libc++abi with Unreal Engine 5.7 clang toolchain
Fixes: # 2. Requests from Project AirSim C++ client not reaching sim server
Fixes: # 3. Timeout for failed requests not implemented on c++ client side causing further requests to be permanently blocked
Fixes: # 4. Timestamps from airsim not passed to published messages by the ROS2 client
About
-lc++abiin link options to ensure build compatibility with Unreal Engine 5.7's v26 clang toollchainfis_canceled_variable inclass TAsyncResultProviderBaseleads to garbage values in the variable which essentially cancels all incoming requests./LoadScenecoincidentlally works, however, none of the requests after scene is loaded work. Explicitly initialisingfis_canceled_fixes the issue. File changed isclient/cpp/ProjectAirsimClientLib/src/AsyncResultInternal.hclient/cpp/ProjectAirsimClientLib/src/Client.cppMakeHeaderand updated its usage inros/projectairsim_ros2_cpp/src/projectairsim_ros2_cpp_node.cppto ensure timestamps from unreal engine are published with ROS2 messagesHow Has This Been Tested?
This was tested by setting up SITL with ardupilot and setting
use_sim_timeparameter for ardupilot to true. This forces ardupilot to use airsim timestamps. Previously it was observed that/clocktopic has no published messages, which leads to a failed integration. However, after the fix the SITL setup worksScreenshots and videos (if appropriate):
ROS2
/clocktopic echo output:This topic previously published nothing.
Refer to this link for a complete test with ArduPilot SITL. The video shows the published timestamps for IMU topics from Project AirSim ROS2 wrapper and ArduPilot SITL and the
/clocktopic published by Project AirSim ROS2 client.