Merge branch 'ros2' of https://github.com/fan-ziqi/rl_sar into ros2-humble

This commit is contained in:
-T.K.- 2024-11-14 00:00:49 -08:00
commit 5ce8604297
3 changed files with 4 additions and 4 deletions

View File

@ -29,7 +29,8 @@ find_package(rclpy REQUIRED)
find_package(gazebo_msgs REQUIRED) find_package(gazebo_msgs REQUIRED)
find_package(std_srvs 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) link_directories(/usr/local/lib)
include_directories(${YAML_CPP_INCLUDE_DIR}) include_directories(${YAML_CPP_INCLUDE_DIR})

View File

@ -54,7 +54,7 @@ class RL_Sim(RL, Node):
self.ReadYaml(self.robot_name) self.ReadYaml(self.robot_name)
for i in range(len(self.params.observations)): for i in range(len(self.params.observations)):
if self.params.observations[i] == "ang_vel": if self.params.observations[i] == "ang_vel":
self.params.observations[i] = "ang_vel_world" self.params.observations[i] = "ang_vel_body"
# init rl # init rl
torch.set_grad_enabled(False) torch.set_grad_enabled(False)

View File

@ -49,10 +49,9 @@ RL_Sim::RL_Sim()
this->ReadYaml(this->robot_name); this->ReadYaml(this->robot_name);
for (std::string &observation : this->params.observations) 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") if (observation == "ang_vel")
{ {
observation = "ang_vel_world"; observation = "ang_vel_body";
} }
} }