Community Blog Buy Now
Blog

Misty Community Forum

Dropping of motion command when driving off of charger

I am building software that has Misty automatically drive onto and off of the charging pad. Fairly consistently (but I have not conducted a study yet), if I start the driving off of the charging pad with a command like POST /api/drive/time, then it is suddenly interrupted and motion stops after the pad is not a power source.

Is there a known solution for having smooth motion off of the charging pad, while transitioning from a state of battery “charging” to “not charging”?

Hey @slivingston, do you have the hazards enabled? We’ve seen some instances where the hazards ‘trigger’ when driving onto and off the charging pad which causes the motion to stop. As we’ve been working on auto charging internally we typically disable the hazards to dock, also so we can back onto the charger and get close to the back of the charging pad.

Thanks for the idea. My only concern is going off of the charging pad because I already have the “onto” case working reliably. For the “onto” case, yes, I adjust the hazard settings.

However, for the “off of” case, adjusting the IR thresholds to 0 is not sufficient, but I will keep trying other values.

My hypothesis is that the failure is related to the change in power source because the sudden stop happens at approximately the same time as when the fan sound pressure level decreases.

@slivingston
Can you capture your robot’s logs just after your robot stops in that position and send them to us? They should have information about what caused the drive to stop.

Just FYI @slivingston, we’ve been driving on and off the charger with the several robots for a while now in some auto-charging tests we’ve been doing and it never fails in the same manner you describe. It’s probably not related to coming off the charger, but, in either case, the logs that @steven asked for should help track down the problem.

logs beginning at time of sending the motion commands:

2020-03-10T06:19:20.9196973-07:00|INF|20192502042|13|CommandRequestHandler|REST_API IN Command: DriveTime SourceId: a5d74bda-0a61-4bf0-aeb9-a6c00fd2ad7f 
2020-03-10T06:19:20.9196973-07:00|INF|20192502042|13|CommandRequestHandler|{"api":"REST_API","direction":"IN","command":"DriveTime","sourceId":"a5d74bda-0a61-4bf0-aeb9-a6c00fd2ad7f"} 
2020-03-10T06:19:20.9196973-07:00|INF|20192502042|13|CommandRequestHandler|REST_API OUT Command: DriveTime SourceId: a5d74bda-0a61-4bf0-aeb9-a6c00fd2ad7f Status: Success 
2020-03-10T06:19:20.9196973-07:00|INF|20192502042|13|CommandRequestHandler|{"api":"REST_API","direction":"OUT","command":"DriveTime","sourceId":"a5d74bda-0a61-4bf0-aeb9-a6c00fd2ad7f","status":"Success"} 
2020-03-10T06:19:21.6357812-07:00|DBG|20192502042|9|VL53L1XTimeOfFlightSensor|Position: Back; Type: Range; Status: 0; AverageTimeMs: 122; Signal: 17992; Sigma: 7; InHazard: False; Distance: 0.072. 
2020-03-10T06:19:23.3544803-07:00|INF|20192502042|3|CommandRequestHandler|REST_API IN Command: DriveTime SourceId: a5d74bda-0a61-4bf0-aeb9-a6c00fd2ad7f 
2020-03-10T06:19:23.3544803-07:00|INF|20192502042|3|CommandRequestHandler|{"api":"REST_API","direction":"IN","command":"DriveTime","sourceId":"a5d74bda-0a61-4bf0-aeb9-a6c00fd2ad7f"} 
2020-03-10T06:19:23.3544803-07:00|INF|20192502042|3|CommandRequestHandler|REST_API OUT Command: DriveTime SourceId: a5d74bda-0a61-4bf0-aeb9-a6c00fd2ad7f Status: Success 
2020-03-10T06:19:23.3544803-07:00|INF|20192502042|3|CommandRequestHandler|{"api":"REST_API","direction":"OUT","command":"DriveTime","sourceId":"a5d74bda-0a61-4bf0-aeb9-a6c00fd2ad7f","status":"Success"} 
2020-03-10T06:19:27.6351833-07:00|DBG|20192502042|9|VL6180XTimeOfFlightSensor|Position: DownFrontRight; Type: Edge; Status: 208; AverageTimeMs: 32; Signal: 5491; Sigma: ; InHazard: True; Distance: 0.255. 
2020-03-10T06:19:27.7559241-07:00|DBG|20192502042|9|VL6180XTimeOfFlightSensor|Position: DownFrontRight; Type: Edge; Status: 0; AverageTimeMs: 31; Signal: 5695; Sigma: ; InHazard: False; Distance: 0.007. 
2020-03-10T06:19:30.7085401-07:00|INF|20192502042|13|CommandRequestHandler|REST_API IN Command: MoveHead SourceId: a5d74bda-0a61-4bf0-aeb9-a6c00fd2ad7f 
2020-03-10T06:19:30.7085401-07:00|INF|20192502042|13|CommandRequestHandler|{"api":"REST_API","direction":"IN","command":"MoveHead","sourceId":"a5d74bda-0a61-4bf0-aeb9-a6c00fd2ad7f"} 
2020-03-10T06:19:30.7241604-07:00|INF|20192502042|13|CommandRequestHandler|REST_API OUT Command: MoveHead SourceId: a5d74bda-0a61-4bf0-aeb9-a6c00fd2ad7f Status: Success 
2020-03-10T06:19:30.7241604-07:00|INF|20192502042|13|CommandRequestHandler|{"api":"REST_API","direction":"OUT","command":"MoveHead","sourceId":"a5d74bda-0a61-4bf0-aeb9-a6c00fd2ad7f","status":"Success"} 
2020-03-10T06:19:33.6502280-07:00|DBG|20192502042|9|VL6180XTimeOfFlightSensor|Position: DownFrontRight; Type: Edge; Status: 208; AverageTimeMs: 30; Signal: 5702; Sigma: ; InHazard: True; Distance: 0.255. 
2020-03-10T06:19:33.7909465-07:00|DBG|20192502042|9|VL6180XTimeOfFlightSensor|Position: DownFrontRight; Type: Edge; Status: 0; AverageTimeMs: 27; Signal: 5616; Sigma: ; InHazard: False; Distance: 0.008. 
2020-03-10T06:19:37.9574766-07:00|DBG|20192502042|9|VL6180XTimeOfFlightSensor|Position: DownFrontRight; Type: Edge; Status: 208; AverageTimeMs: 32; Signal: 5702; Sigma: ; InHazard: True; Distance: 0.255. 
2020-03-10T06:19:38.1222968-07:00|DBG|20192502042|9|VL6180XTimeOfFlightSensor|Position: DownFrontRight; Type: Edge; Status: 0; AverageTimeMs: 30; Signal: 5735; Sigma: ; InHazard: False; Distance: 0.013. 
2020-03-10T06:19:45.9005611-07:00|ERR|20192502042|9|FirmwareLogMessageReceiver|RtcBoard: 06:19:45.900 HardFault => TaskManager (2): RT memory use warning. ID: 10. Remaining: 15. 
2020-03-10T06:19:47.5318104-07:00|DBG|20192502042|9|VL6180XTimeOfFlightSensor|Position: DownFrontRight; Type: Edge; Status: 208; AverageTimeMs: 32; Signal: 5622; Sigma: ; InHazard: True; Distance: 0.255. 
2020-03-10T06:19:47.6962223-07:00|DBG|20192502042|9|VL6180XTimeOfFlightSensor|Position: DownFrontRight; Type: Edge; Status: 0; AverageTimeMs: 33; Signal: 5551; Sigma: ; InHazard: False; Distance: 0.009. 
2020-03-10T06:19:56.4261385-07:00|INF|20192502042|11|CommandRequestHandler|REST_API IN Command: GetDeviceInformation SourceId: a5d74bda-0a61-4bf0-aeb9-a6c00fd2ad7f 
2020-03-10T06:19:56.4261385-07:00|INF|20192502042|11|CommandRequestHandler|{"api":"REST_API","direction":"IN","command":"GetDeviceInformation","sourceId":"a5d74bda-0a61-4bf0-aeb9-a6c00fd2ad7f"} 
2020-03-10T06:19:56.4573769-07:00|INF|20192502042|6|RemoteServiceMother|Wifi status = InternetAccess. Wifi IP = 192.168.2.214. 
2020-03-10T06:19:56.4573769-07:00|INF|20192502042|11|CommandRequestHandler|REST_API OUT Command: GetDeviceInformation SourceId: a5d74bda-0a61-4bf0-aeb9-a6c00fd2ad7f Status: Success 
2020-03-10T06:19:56.4573769-07:00|INF|20192502042|11|CommandRequestHandler|{"api":"REST_API","direction":"OUT","command":"GetDeviceInformation","sourceId":"a5d74bda-0a61-4bf0-aeb9-a6c00fd2ad7f","status":"Success"} 
2020-03-10T06:19:56.5787879-07:00|INF|20192502042|7|CommandRequestHandler|REST_API IN Command: GetStoreUpdateAvailable SourceId: a5d74bda-0a61-4bf0-aeb9-a6c00fd2ad7f 
2020-03-10T06:19:56.5787879-07:00|INF|20192502042|7|CommandRequestHandler|{"api":"REST_API","direction":"IN","command":"GetStoreUpdateAvailable","sourceId":"a5d74bda-0a61-4bf0-aeb9-a6c00fd2ad7f"} 
2020-03-10T06:19:56.5787879-07:00|INF|20192502042|7|UpdateManager|Checking for store updates. 
2020-03-10T06:19:56.6412915-07:00|INF|20192502042|12|PubSubRequestHandler|Web socket connection established 
2020-03-10T06:19:56.7194041-07:00|INF|20192502042|3|CommandRequestHandler|REST_API IN Command: GetListOfAudioFiles SourceId: a5d74bda-0a61-4bf0-aeb9-a6c00fd2ad7f 
2020-03-10T06:19:56.7194041-07:00|INF|20192502042|3|CommandRequestHandler|{"api":"REST_API","direction":"IN","command":"GetListOfAudioFiles","sourceId":"a5d74bda-0a61-4bf0-aeb9-a6c00fd2ad7f"} 
2020-03-10T06:19:56.7194041-07:00|INF|20192502042|6|AudioRemoteServiceManager|Retrieving audio files list. 
2020-03-10T06:19:56.7194041-07:00|INF|20192502042|6|RemoteServiceLogger|GetAudioServiceEnabled invoked. Service is enabled. 
2020-03-10T06:19:56.7350314-07:00|INF|20192502042|15|RemoteServiceLogger|Get file list command 
2020-03-10T06:19:56.7662792-07:00|INF|20192502042|12|CommandRequestHandler|REST_API IN Command: GetListOfImages SourceId: a5d74bda-0a61-4bf0-aeb9-a6c00fd2ad7f 
2020-03-10T06:19:56.7662792-07:00|INF|20192502042|12|CommandRequestHandler|{"api":"REST_API","direction":"IN","command":"GetListOfImages","sourceId":"a5d74bda-0a61-4bf0-aeb9-a6c00fd2ad7f"} 
2020-03-10T06:19:56.7662792-07:00|INF|20192502042|12|CommandRequestHandler|REST_API OUT Command: GetListOfImages SourceId: a5d74bda-0a61-4bf0-aeb9-a6c00fd2ad7f Status: Success 
2020-03-10T06:19:56.7662792-07:00|INF|20192502042|12|CommandRequestHandler|{"api":"REST_API","direction":"OUT","command":"GetListOfImages","sourceId":"a5d74bda-0a61-4bf0-aeb9-a6c00fd2ad7f","status":"Success"} 
2020-03-10T06:19:56.7662792-07:00|DBG|20192502042|15|AudioRemoteServiceManager|Decoding 75 audio assets 
2020-03-10T06:19:56.7662792-07:00|DBG|20192502042|15|AudioRemoteServiceManager|Finished decoding audio assets 
2020-03-10T06:19:56.7662792-07:00|INF|20192502042|3|CommandRequestHandler|REST_API OUT Command: GetListOfAudioFiles SourceId: a5d74bda-0a61-4bf0-aeb9-a6c00fd2ad7f Status: Success 
2020-03-10T06:19:56.7662792-07:00|INF|20192502042|3|CommandRequestHandler|{"api":"REST_API","direction":"OUT","command":"GetListOfAudioFiles","sourceId":"a5d74bda-0a61-4bf0-aeb9-a6c00fd2ad7f","status":"Success"} 
2020-03-10T06:19:56.8913117-07:00|INF|20192502042|3|CommandRequestHandler|REST_API IN Command: GetListOfVideos SourceId: a5d74bda-0a61-4bf0-aeb9-a6c00fd2ad7f 
2020-03-10T06:19:56.8913117-07:00|INF|20192502042|3|CommandRequestHandler|{"api":"REST_API","direction":"IN","command":"GetListOfVideos","sourceId":"a5d74bda-0a61-4bf0-aeb9-a6c00fd2ad7f"} 
2020-03-10T06:19:56.8913117-07:00|INF|20192502042|3|CommandRequestHandler|REST_API OUT Command: GetListOfVideos SourceId: a5d74bda-0a61-4bf0-aeb9-a6c00fd2ad7f Status: Success 
2020-03-10T06:19:56.8913117-07:00|INF|20192502042|3|CommandRequestHandler|{"api":"REST_API","direction":"OUT","command":"GetListOfVideos","sourceId":"a5d74bda-0a61-4bf0-aeb9-a6c00fd2ad7f","status":"Success"} 
2020-03-10T06:19:57.0165270-07:00|DBG|20192502042|17|PubSubWebSocketManager|Registered API event: ActuatorPosition_ahp139 
2020-03-10T06:19:57.0165270-07:00|DBG|20192502042|17|PubSubWebSocketManager|Registered API event: ActuatorPosition_ahr977 
2020-03-10T06:19:57.0321395-07:00|DBG|20192502042|17|PubSubWebSocketManager|Registered API event: ActuatorPosition_ahy572 
2020-03-10T06:19:57.0321395-07:00|DBG|20192502042|17|PubSubWebSocketManager|Registered API event: ActuatorPosition_ala351 
2020-03-10T06:19:57.0321395-07:00|DBG|20192502042|17|PubSubWebSocketManager|Registered API event: ActuatorPosition_ara177 
2020-03-10T06:19:57.3870585-07:00|DBG|20192502042|14|PubSubWebSocketManager|Unregistered API event: ActuatorPosition_ara177 
2020-03-10T06:19:57.4495605-07:00|DBG|20192502042|14|PubSubWebSocketManager|Unregistered API event: ActuatorPosition_ala351 
2020-03-10T06:19:57.4651879-07:00|DBG|20192502042|14|PubSubWebSocketManager|Unregistered API event: ActuatorPosition_ahp139 
2020-03-10T06:19:57.4651879-07:00|DBG|20192502042|14|PubSubWebSocketManager|Unregistered API event: ActuatorPosition_ahr977 
2020-03-10T06:19:57.4651879-07:00|DBG|20192502042|14|PubSubWebSocketManager|Unregistered API event: ActuatorPosition_ahy572 
2020-03-10T06:19:58.7942473-07:00|DBG|20192502042|9|VL6180XTimeOfFlightSensor|Position: DownFrontRight; Type: Edge; Status: 208; AverageTimeMs: 30; Signal: 5672; Sigma: ; InHazard: True; Distance: 0.255. 
2020-03-10T06:19:58.9348841-07:00|DBG|20192502042|9|VL6180XTimeOfFlightSensor|Position: DownFrontRight; Type: Edge; Status: 0; AverageTimeMs: 30; Signal: 5735; Sigma: ; InHazard: False; Distance: 0.009. 
2020-03-10T06:19:59.9039601-07:00|INF|20192502042|11|UpdateManager|No store updates available. 
2020-03-10T06:19:59.9039601-07:00|INF|20192502042|7|CommandRequestHandler|REST_API OUT Command: GetStoreUpdateAvailable SourceId: a5d74bda-0a61-4bf0-aeb9-a6c00fd2ad7f Status: Success 
2020-03-10T06:19:59.9039601-07:00|INF|20192502042|7|CommandRequestHandler|{"api":"REST_API","direction":"OUT","command":"GetStoreUpdateAvailable","sourceId":"a5d74bda-0a61-4bf0-aeb9-a6c00fd2ad7f","status":"Success"} 
2020-03-10T06:20:04.1021242-07:00|INF|20192502042|11|CommandRequestHandler|REST_API IN Command: GetLogFile SourceId: a5d74bda-0a61-4bf0-aeb9-a6c00fd2ad7f 
2020-03-10T06:20:04.1021242-07:00|INF|20192502042|11|CommandRequestHandler|{"api":"REST_API","direction":"IN","command":"GetLogFile","sourceId":"a5d74bda-0a61-4bf0-aeb9-a6c00fd2ad7f"} 

My original comment of “fairly consistent” has a weak “fairly”: often enough to where it is a problem that I want to solve. I still have not conducted trials, but here are 2 details that might help in comparing your tests to mine:

  1. the robot has been on the charging pad for > 6 hours
  2. the robot is powered on continuously for > 10 days

The code that is executed on a remote host is at the end of this post. mpurl should have a rerobots mistyproxy URL, but if the robot is local, mpurl can have the IP address of the robot.

Notice that /api/drive/time is called twice. Doing so is my attempt to account for the motion command being dropped. Otherwise, a single motion command is more intuitive.

Hopefully I missed something, but I am not aware of a method for confirming the hazard setting values. In any case, I POSTed the following to /api/hazard/updatebasesettings:

{
  "bumpSensorsEnabled": [
    {
      "sensorName": "Bump_FrontRight",
      "enabled": true
    },
    {
      "sensorName": "Bump_FrontLeft",
      "enabled": true
    },
    {
      "sensorName": "Bump_RearRight",
      "enabled": true
    },
    {
      "sensorName": "Bump_RearLeft",
      "enabled": true
    }
  ],
  "timeOfFlightThresholds": [
    {
      "sensorName": "TOF_DownFrontRight",
      "threshold": 0
    },
    {
      "sensorName": "TOF_DownFrontLeft",
      "threshold": 0
    },
    {
      "sensorName": "TOF_DownBackRight",
      "threshold": 0
    },
    {
      "sensorName": "TOF_DownBackLeft",
      "threshold": 0
    },
    {
      "sensorName": "TOF_Right",
      "threshold": 0.15
    },
    {
      "sensorName": "TOF_Left",
      "threshold": 0.15
    },
    {
      "sensorName": "TOF_Center",
      "threshold": 0.15
    },
    {
      "sensorName": "TOF_Back",
      "threshold": 0.15
    }
  ]
}

Notice that all TOF_Down parameters are 0.

Finally, here is a view of the charging pad and workspace: rerobots-example-webcam-20200310

import time
import requests


def drive_fwd(mpurl, duration):
    """Drive forward for given duration (ms)
    """
    params = {
        'LinearVelocity': 10,
        'AngularVelocity': 0,
        'TimeMS': duration,
    }
    res = requests.post(mpurl + '/api/drive/time', json=params)
    if not res.ok:
        print('response from POST /api/drive/time:',
              res.status_code,
              res.reason)


print('Starting...')

# rerobots mistyproxy URL
mpurl = ''

drive_fwd(mpurl, 2000)  # Move off charging pad
time.sleep(2)  # Wait for motion to complete

drive_fwd(mpurl, 7000)  # Drive toward camera
time.sleep(7)  # Wait for motion to complete

# Look up
params = {
    'Pitch': -25,
    'Roll': 0,
    'Yaw': 0,
    'Velocity': 80,
    'Units': 'degrees',
}
res = requests.post(mpurl + '/api/head', json=params)
if not res.ok:
    print('response from POST /api/head:',
          res.status_code,
          res.reason)

print('Done.')

@slivingston

According to the log you sent, it appears that your front right edge sensor is triggering a hazard. The type of error I’m seeing suggests that there is something on the cover glass of the sensor. Can you inspect the cover glass on that sensor to see if anything stands out, and then try cleaning it (you can follow the procedure recommended here). Give that a shot and see if that helps. Even small specs of dust, in the right spot, can cause problems.

After you do that, with the robot sitting squarely on the charger, can you go into command center, subscribe to that front right edge sensor and tell me what range values you are observing. You should see somewhere around 20 mm. Currently your sensor appears to be reporting less than half that, strongly suggesting something on the cover glass is causing a return. This would cause a drive hazard to be triggered.

This hazard should be suppressed with the adjust thresholds command you’re sending. I’ll verify that it does get suppressed sometime in the next couple days. In the meantime, you might send the adjust threshold command twice just in case it is missing it the first time.

Let us know if this helps.

Thanks!

Thanks for your comments. I am traveling and unable to check for dust until 16 Mar.

Meanwhile, I have remote access, so I will play with the hazard settings. It would be great if "status": "Success" in the response to Misty REST API requests implied success. Currently this text in the response does not indicate anything more than the HTTP status code itself (200 OK) from the perspective of clients.

I understand for some commands, e.g., POST /api/drive/time, it is difficult to make guarantees about results within the path of 1 HTTP request-response pair.

1 Like

The error that I describe remains, despite me adjusting hazard settings and despite me trying to clean the small distance range finders.

For the sake of comparison, @Vlad, can you share code that is known to work on the Misty company side?

One way to overcome this is to increase the forward speed, as first proposed to me by @BoulderAl. I am performing trials now to find if this is reliable.

I found a workaround where the /api/drive/time command is sent several times in sequence. You can try it yourself at sandbox - rerobots