Skip to content

Commit d6b7d0e

Browse files
committed
exteneded paramters list for warp dphys
1 parent 78ae708 commit d6b7d0e

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

launch/dphysics.launch

+5-3
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
robot_clearance: 0.132
1616
hm_topic: $(arg hm_topic)
1717
hm_frame: $(arg hm_frame)
18-
linear_vels: [0.5, 0.5, 0.5, -0.4]
19-
angular_vels: [0.0, 0.3, -0.3, 0.0]
18+
linear_vels: [0.5, 0.5, 0.5, -0.4, 0.0]
19+
angular_vels: [0.0, 0.3, -0.3, 0.0, 0.2]
2020
total_sim_time: $(arg total_sim_time)
2121
max_age: $(arg max_age)
2222
</rosparam>
@@ -28,8 +28,10 @@
2828
hm_frame: $(arg hm_frame)
2929
max_age: $(arg max_age)
3030
total_sim_time: $(arg total_sim_time)
31-
n_sim_trajs: 40
31+
n_sim_trajs: 60
3232
allow_backward: true
33+
linear_vel: 0.5
34+
angular_vel_max: 0.6
3335
device: $(arg device)
3436
</rosparam>
3537
</node>

nodes/diff_physics_warp

+8-3
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,10 @@ class DiffPhysicsWarp:
101101
v_l = vels[i] - r * omegas[i]
102102
track_vels[i, :, 0], track_vels[i, :, 1] = v_r, v_l
103103

104-
# control input to rotate 180 degrees
105-
track_vels[-1, :, 0] = -linear_vel
106-
track_vels[-1, :, 1] = linear_vel
104+
if not allow_backward:
105+
# control input to rotate 180 degrees
106+
track_vels[-1, :, 0] = -linear_vel
107+
track_vels[-1, :, 1] = linear_vel
107108

108109
return track_vels
109110

@@ -254,6 +255,8 @@ def main():
254255
total_sim_time = rospy.get_param('~total_sim_time', 10.0)
255256
n_sim_trajs = rospy.get_param('~n_sim_trajs', 40)
256257
allow_backward = rospy.get_param('~allow_backward', True)
258+
linear_vel = rospy.get_param('~linear_vel', 0.5)
259+
angular_vel_max = rospy.get_param('~angular_vel_max', 0.5)
257260
device = rospy.get_param('~device', 'cuda' if torch.cuda.is_available() else 'cpu')
258261

259262
node = DiffPhysicsWarp(robot=robot, robot_clearance=robot_clearance,
@@ -262,6 +265,8 @@ def main():
262265
total_sim_time=total_sim_time,
263266
n_sim_trajs=n_sim_trajs,
264267
allow_backward=allow_backward,
268+
linear_vel=linear_vel,
269+
angular_vel_max=angular_vel_max,
265270
device=device)
266271
node.spin()
267272

0 commit comments

Comments
 (0)