From 6fd0136d4418cf818ddcb873d4627a54779cd08f Mon Sep 17 00:00:00 2001 From: "-T.K.-" Date: Tue, 12 Nov 2024 05:38:17 -0800 Subject: [PATCH 1/2] fix: let CMake find the correct Python version when building for ROS2 Foxy (#38) * fix: finding correct python version --------- Co-authored-by: robotsfan --- src/rl_sar/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rl_sar/CMakeLists.txt b/src/rl_sar/CMakeLists.txt index 68b2eb9..951d4bd 100644 --- a/src/rl_sar/CMakeLists.txt +++ b/src/rl_sar/CMakeLists.txt @@ -29,7 +29,8 @@ find_package(rclpy REQUIRED) find_package(gazebo_msgs REQUIRED) find_package(std_srvs REQUIRED) -find_package(Python3 COMPONENTS Interpreter Development REQUIRED) +# Make sure to find Python 3.8 +find_package(Python3 3.8 EXACT COMPONENTS Interpreter Development REQUIRED) link_directories(/usr/local/lib) include_directories(${YAML_CPP_INCLUDE_DIR}) From 4124f78e1cae2d850992dfa3aa7595cbef936ab2 Mon Sep 17 00:00:00 2001 From: fan-ziqi Date: Wed, 13 Nov 2024 10:56:13 +0800 Subject: [PATCH 2/2] fix: the angular velocity of the IMU topic is in the body coordinate system. Close #39 --- src/rl_sar/scripts/rl_sim.py | 2 +- src/rl_sar/src/rl_sim.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/rl_sar/scripts/rl_sim.py b/src/rl_sar/scripts/rl_sim.py index abb7f64..b4ed030 100755 --- a/src/rl_sar/scripts/rl_sim.py +++ b/src/rl_sar/scripts/rl_sim.py @@ -54,7 +54,7 @@ class RL_Sim(RL, Node): self.ReadYaml(self.robot_name) for i in range(len(self.params.observations)): if self.params.observations[i] == "ang_vel": - self.params.observations[i] = "ang_vel_world" + self.params.observations[i] = "ang_vel_body" # init rl torch.set_grad_enabled(False) diff --git a/src/rl_sar/src/rl_sim.cpp b/src/rl_sar/src/rl_sim.cpp index 57cf071..44806d4 100644 --- a/src/rl_sar/src/rl_sim.cpp +++ b/src/rl_sar/src/rl_sim.cpp @@ -41,10 +41,9 @@ RL_Sim::RL_Sim() this->ReadYaml(this->robot_name); for (std::string &observation : this->params.observations) { - // In Gazebo, the coordinate system for angular velocity is in the world coordinate system. if (observation == "ang_vel") { - observation = "ang_vel_world"; + observation = "ang_vel_body"; } }