Robot Engage Blog Buy Now
Blog

Misty Community Forum

Modifying Misty's Drive Hazards Settings

Misty has 12 sensors that can trigger an external hazard and cause the robot to ignore drive commands. These sensors are grouped into 3 separate categories:

  • bump sensors (4x)
  • obstacle detection (range) sensors (4x)
  • cliff detection (edge) sensors (4x)

You can toggle each of these sensor hazards on or off with Misty’s REST API. In addition, you can adjust the threshold for the range and edge sensors to tune the hazards system to your particular needs.

To adjust these settings, you can use the UpdateBaseHazardManagementSettings operation in Misty’s REST API. The examples below show how to issue requests to modify Misty’s hazard settings using curl or Postman.

The requests in the examples below disable Misty’s edge and range hazard sensors by setting the threshold values to 0, and leave Misty’s bump sensor hazards enabled. In this condition, Misty will drive off of tables and over stairs, and she will not stop driving until she bumps an obstacle and triggers a sensor. To modify the range and edge hazard settings (instead of disabling them entirely), you can pass in a custom value greater than 0 for the threshold parameter. This threshold value is the distance (in meters) at which the sensor triggers a hazard state. (For a bit more on Misty’s hazards system, see Misty’s developer documentation)

Important! Adjusting the hazard settings can improve Misty’s performance in different environments, but should always be done with caution. Always supervise your robot while she is operating with custom hazards settings, and be ready to catch her in the event that she tips over a high ledge.

Modifying Hazards with curl

To disable following script and run it in your Mac terminal (or Windows Command Prompt, if you have curl installed). This script disables the edge and range sensor hazards completely by setting the threshold to 0, but you can adjust the threshold to suit your needs.

curl -X POST \
  http://<robot-ip-address>/api/hazard/updatebasesettings \
  -d '{
    "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.1},
        {"sensorName":"TOF_Left","threshold":0.1},
        {"sensorName":"TOF_Center","threshold":0.1},
        {"sensorName":"TOF_Back","threshold":0.1}
    ]
}'

This gist is also on GitHub.

Modifying Hazards with Postman

As an alternative to using the command line, you can also send this same command using a REST client like Postman. Follow these instructions to do so:

  1. Download and install Postman
  2. Create a new POST request for the <robot-ip-address>/api/hazard/updatebasesettings endpoint.
  3. Under the Headers tab, set the Content-Type to application/json
  4. Under the Body tab, select raw and paste the following JSON object:
{
    "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},
        {"sensorName":"TOF_Left","threshold":0},
        {"sensorName":"TOF_Center","threshold":0},
        {"sensorName":"TOF_Back","threshold":0}
    ]
}

Your request should look like this:

26%20PM

  1. Click Send.

Important Notes

  • Currently, Misty uses her edge sensors to detect when she has tipped over, and thus stops her drive mechanisms. If you disable Misty’s edge sensors, she won’t stop driving if she tips over. (This behavior is likely to change with future upgrades to the hazards system, but for now it is an important note to be aware of.)
  • Misty resets the hazard settings to their default values each time you power cycle the robot. These defaults are: bump sensors enabled, edge sensor threshold at 50 mm, and range sensor threshold at 150 mm. If you want to work with customized hazard settings, you must issue a command to adjust the settings each time you power cycle your Misty II.
2 Likes

Another way to do it is also in our API Explorer:
http://sdk.mistyrobotics.com/api-explorer/index.html

In the list of APIs

You’ll see an API: UpdateBaseManagmentSettings

You can set the TOFs Parameters to 0 and send the request.