@@ -1314,20 +1314,16 @@ def velocity_cmd(
13141314 """
13151315 start_time = now_sec () if timestamp is None else timestamp
13161316 end_time = start_time + cmd_duration
1317+ mobility_params = spot_command_pb2 .MobilityParams ()
1318+ mobility_params .CopyFrom (self .get_mobility_params ())
1319+ if not use_obstacle_params :
1320+ mobility_params .ClearField ("obstacle_params" )
13171321 if body_height :
1318- current_mobility_params = self .get_mobility_params ()
1319- height_adjusted_params = RobotCommandBuilder .mobility_params (
1320- body_height = body_height ,
1321- locomotion_hint = current_mobility_params .locomotion_hint ,
1322- stair_hint = current_mobility_params .stair_hint ,
1323- external_force_params = current_mobility_params .external_force_params ,
1324- stairs_mode = current_mobility_params .stairs_mode ,
1322+ mobility_params .body_control .CopyFrom (
1323+ RobotCommandBuilder .mobility_params (body_height = body_height ).body_control
13251324 )
1326- if use_obstacle_params :
1327- height_adjusted_params .obstacle_params .CopyFrom (current_mobility_params .obstacle_params )
1328- self .set_mobility_params (height_adjusted_params )
13291325 response = self ._robot_command (
1330- RobotCommandBuilder .synchro_velocity_command (v_x = v_x , v_y = v_y , v_rot = v_rot , params = self . _mobility_params ),
1326+ RobotCommandBuilder .synchro_velocity_command (v_x = v_x , v_y = v_y , v_rot = v_rot , params = mobility_params ),
13311327 end_time_secs = end_time ,
13321328 timesync_endpoint = self ._robot .time_sync .endpoint ,
13331329 )
0 commit comments