Skip to content

Commit

Permalink
exteneded paramters list for warp dphys
Browse files Browse the repository at this point in the history
  • Loading branch information
RuslanAgishev committed Jun 14, 2024
1 parent 78ae708 commit d6b7d0e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
8 changes: 5 additions & 3 deletions launch/dphysics.launch
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
robot_clearance: 0.132
hm_topic: $(arg hm_topic)
hm_frame: $(arg hm_frame)
linear_vels: [0.5, 0.5, 0.5, -0.4]
angular_vels: [0.0, 0.3, -0.3, 0.0]
linear_vels: [0.5, 0.5, 0.5, -0.4, 0.0]
angular_vels: [0.0, 0.3, -0.3, 0.0, 0.2]
total_sim_time: $(arg total_sim_time)
max_age: $(arg max_age)
</rosparam>
Expand All @@ -28,8 +28,10 @@
hm_frame: $(arg hm_frame)
max_age: $(arg max_age)
total_sim_time: $(arg total_sim_time)
n_sim_trajs: 40
n_sim_trajs: 60
allow_backward: true
linear_vel: 0.5
angular_vel_max: 0.6
device: $(arg device)
</rosparam>
</node>
Expand Down
11 changes: 8 additions & 3 deletions nodes/diff_physics_warp
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,10 @@ class DiffPhysicsWarp:
v_l = vels[i] - r * omegas[i]
track_vels[i, :, 0], track_vels[i, :, 1] = v_r, v_l

# control input to rotate 180 degrees
track_vels[-1, :, 0] = -linear_vel
track_vels[-1, :, 1] = linear_vel
if not allow_backward:
# control input to rotate 180 degrees
track_vels[-1, :, 0] = -linear_vel
track_vels[-1, :, 1] = linear_vel

return track_vels

Expand Down Expand Up @@ -254,6 +255,8 @@ def main():
total_sim_time = rospy.get_param('~total_sim_time', 10.0)
n_sim_trajs = rospy.get_param('~n_sim_trajs', 40)
allow_backward = rospy.get_param('~allow_backward', True)
linear_vel = rospy.get_param('~linear_vel', 0.5)
angular_vel_max = rospy.get_param('~angular_vel_max', 0.5)
device = rospy.get_param('~device', 'cuda' if torch.cuda.is_available() else 'cpu')

node = DiffPhysicsWarp(robot=robot, robot_clearance=robot_clearance,
Expand All @@ -262,6 +265,8 @@ def main():
total_sim_time=total_sim_time,
n_sim_trajs=n_sim_trajs,
allow_backward=allow_backward,
linear_vel=linear_vel,
angular_vel_max=angular_vel_max,
device=device)
node.spin()

Expand Down

0 comments on commit d6b7d0e

Please sign in to comment.