diff --git a/README.md b/README.md index d3d16aa..4e3ad08 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ You can refer to [config.yaml](Simulator/src/config/config.yaml) for modificatio **3. Start the YOPO Planner** -You can refer to [traj_opt.yaml](YOPO/config/traj_opt.yaml) for modification of the flight speed (The given weights are pretrained at 6 m/s and perform smoothly at speeds between 0 - 6 m/s). +You can refer to [traj_opt.yaml](YOPO/config/traj_opt.yaml) for modification of the flight speed (The given weights are pretrained at 6 m/s and perform smoothly at speeds between 0 - 6 m/s, and more pretrained models are available at [Releases](https://github.com/TJU-Aerial-Robotics/YOPO/releases)). ``` cd YOPO diff --git a/YOPO/loss/guidance_loss.py b/YOPO/loss/guidance_loss.py index b26ca0a..e844545 100644 --- a/YOPO/loss/guidance_loss.py +++ b/YOPO/loss/guidance_loss.py @@ -66,7 +66,7 @@ class GuidanceLoss(nn.Module): goal_length = goal_dir.norm(dim=1) # [B] # length difference along goal direction (cosine similarity) - parallel_diff = (goal_length - traj_along).abs() # [B] + parallel_diff = F.smooth_l1_loss(goal_length, traj_along, reduction='none') # length perpendicular to goal direction traj_perp = traj_dir - traj_along.unsqueeze(1) * goal_dir_norm # [B, 3] diff --git a/YOPO/saved/YOPO_1/epoch50.pth b/YOPO/saved/YOPO_1/epoch50.pth old mode 100755 new mode 100644 index 54e988c..17c1ea8 Binary files a/YOPO/saved/YOPO_1/epoch50.pth and b/YOPO/saved/YOPO_1/epoch50.pth differ diff --git a/YOPO/saved/YOPO_1/events.out.tfevents.1749801999.610.2449545.0 b/YOPO/saved/YOPO_1/events.out.tfevents.1749801999.610.2449545.0 deleted file mode 100755 index 9f0617e..0000000 Binary files a/YOPO/saved/YOPO_1/events.out.tfevents.1749801999.610.2449545.0 and /dev/null differ diff --git a/YOPO/saved/YOPO_1/events.out.tfevents.1763990916.610.3199703.0 b/YOPO/saved/YOPO_1/events.out.tfevents.1763990916.610.3199703.0 new file mode 100644 index 0000000..6fc9ade Binary files /dev/null and b/YOPO/saved/YOPO_1/events.out.tfevents.1763990916.610.3199703.0 differ diff --git a/YOPO/test_yopo_ros.py b/YOPO/test_yopo_ros.py index 4ae4ad0..841673a 100644 --- a/YOPO/test_yopo_ros.py +++ b/YOPO/test_yopo_ros.py @@ -140,7 +140,7 @@ class YopoNet: obs = np.concatenate((vel_c, acc_c, goal_c), axis=0).astype(np.float32) obs_norm = self.state_transform.normalize_obs(torch.from_numpy(obs[None, :])) - return obs_norm.to(self.device, non_blocking=True) + return obs_norm @torch.inference_mode() def callback_depth(self, data): @@ -171,9 +171,8 @@ class YopoNet: # input prepare time1 = time.time() depth_input = torch.from_numpy(depth).to(self.device, non_blocking=True) # (non_blocking: copying speed 3x) - obs_norm = self.process_odom() + obs_norm = self.process_odom().to(self.device, non_blocking=True) obs_input = self.state_transform.prepare_input(obs_norm) - obs_input = obs_input.to(self.device, non_blocking=True) # torch.cuda.synchronize() time2 = time.time()