abizovnuralem / go2_omniverse

Unitree Go2, Unitree G1 support for Nvidia Isaac Lab (Isaac Gym / Isaac Sim)
BSD 2-Clause "Simplified" License
378 stars 36 forks source link

Go2 doesn't move if velocity is less than 1.0 #36

Closed richard98hess444 closed 2 months ago

richard98hess444 commented 2 months ago

Hi,

I found that the robot Go2 doesn't move when the velocity command is less than 1.0. I tried it with changing values in sub_keyboard_event like custom_rl_env.base_command["0"] = [0.8, 0, 0] or using

ros2 topic pub /robot0/cmd_vel geometry_msgs/msg/Twist "{linear: {x: 0.8, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 0.0}}"

Both can't make Go2 move. Where can I tune these velocity limit?

BTW I'm using

( after the update, it runs truely faster than 4.1, great!)

richard98hess444 commented 2 months ago

Hi, I've figured out the problem.

Inside the constant_commands function from custom_rl_env.py, where the tensor list is created

tensor_lst = torch.tensor([0, 0, 0], device=env.device).repeat(env.num_envs, 1)

[0, 0, 0] is the cause since the dtype is assigned as integer. I replace the line by

tensor_lst = torch.tensor([0.0, 0.0, 0.0], dtype=torch.float32, device=env.device).repeat(env.num_envs, 1)

and the problem is solved!

abizovnuralem commented 2 months ago

Hello! I will be very happy for your pr, dear @richard98hess444 !

abizovnuralem commented 2 months ago

Thanks, @richard98hess444 !