Skip to content

Commit

Permalink
default velocities are now nonzero, apply formatting, remove extra va…
Browse files Browse the repository at this point in the history
…riables in trajectory vel limit check
  • Loading branch information
heuristicus committed May 3, 2023
1 parent d5b57ea commit ac30dab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
8 changes: 4 additions & 4 deletions spot_driver/launch/driver.launch
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<arg name="hostname" default="192.168.50.3" />
<arg name="estop_timeout" default="9.0"/>
<arg name="autonomy_enabled" default="true"/>
<!-- In m/s. 0 applies spot's internal limits -->
<arg name="max_linear_velocity_x" default="0"/>
<arg name="max_linear_velocity_y" default="0"/>
<arg name="max_angular_velocity_z" default="0"/>
<!-- In m/s. -->
<arg name="max_linear_velocity_x" default="0.5"/>
<arg name="max_linear_velocity_y" default="0.5"/>
<arg name="max_angular_velocity_z" default="0.5"/>
<arg name="allow_motion" default="true"/>
<arg name="driver_config" default="$(find spot_driver)/config/spot_ros.yaml"/>

Expand Down
11 changes: 6 additions & 5 deletions spot_driver/src/spot_driver/spot_ros.py
Original file line number Diff line number Diff line change
Expand Up @@ -828,13 +828,14 @@ def handle_trajectory(self, req):
return

mobility_params = self.spot_wrapper.get_mobility_params()
max_lin_vel_x=mobility_params.vel_limit.max_vel.linear.x
max_lin_vel_y=mobility_params.vel_limit.max_vel.linear.y
max_angular_vel=mobility_params.vel_limit.max_vel.angular
if max_lin_vel_x==0 or max_lin_vel_y==0 or max_angular_vel==0:
if (
mobility_params.vel_limit.max_vel.linear.x == 0
or mobility_params.vel_limit.max_vel.linear.y == 0
or mobility_params.vel_limit.max_vel.angular == 0
):
rospy.logerr(
"Spot will not move as one or more of its velocity limits are set to 0. "
)
)
self.trajectory_server.set_aborted(
TrajectoryResult(False, "Velocity limits are set to 0.")
)
Expand Down

0 comments on commit ac30dab

Please sign in to comment.