Closed wangkang123123 closed 4 weeks ago
Q1: def euler_from_quat(quat_angle): #order : xyzw """ Convert a quaternion into euler angles (roll, pitch, yaw) roll is rotation around x in radians (counterclockwise) pitch is rotation around y in radians (counterclockwise) yaw is rotation around z in radians (counterclockwise) """ x = quat_angle[:,0]; y = quat_angle[:,1]; z = quat_angle[:,2]; w = quat_angle[:,3] t0 = +2.0 (w x + y z) t1 = +1.0 - 2.0 (x x + y y) roll_x = torch.atan2(t0, t1) t2 = +2.0 (w y - z x) t2 = torch.clip(t2, -1, 1) pitch_y = torch.asin(t2) t3 = +2.0 (w z + x y) t4 = +1.0 - 2.0 (y y + z * z) yaw_z = torch.atan2(t3, t4) return roll_x, pitch_y, yaw_z # in radians
Q2: python train.py --rl_device=cuda:0 --sim_device=cuda:0
airbot报错:
File "/home/kang/eth_legged_gym/legged_gym/legged_gym/envs/base/legged_robot.py", line 75, in __init__ self._init_buffers() File "/home/kang/eth_legged_gym/legged_gym/legged_gym/envs/airbot/airbot_robot.py", line 630, in _init_buffers base_yaw = euler_from_quat(self.base_quat)[2] NameError: name 'euler_from_quat' is not defined
b2w报错:File "/home/kang/.local/lib/python3.8/site-packages/torch/serialization.py", line 265, in _cuda_deserialize device = validate_cuda_device(location) File "/home/kang/.local/lib/python3.8/site-packages/torch/serialization.py", line 256, in validate_cuda_device raise RuntimeError('Attempting to deserialize object on CUDA device ' RuntimeError: Attempting to deserialize object on CUDA device 1 but torch.cuda.device_count() is 1. Please use torch.load with map_location to map your storages to an existing device.
不知道怎么解决