An autonomous cleaning device, such as a robotic vacuum, having an optical sensor that comprises a rotary body adapted to rotate relative to a main body about a rotational axis, a light-emitting device provided on the rotary body, a light-receiving device provided on the rotary body, a cover disposed upward of the rotary body, and legs disposed around the rotary body and supporting the cover with respect to the main body, characterized in that (i) in a cross section orthogonal to the rotational axis, each of the legs comprises at least one surface (71, 72, 75A, 75B) that is inclined with respect to a virtual radial line extending in a radial direction of the rotational axis such that it is parallel to, or coincides with, the optical axis (Xa) when at least a portion of one of the legs faces a light-emitting surface of the light-emitting device, wherein an optical axis (Xa) of the light-emitting device is inclined with respect to the virtual radial line, and/or (ii) in a cross section orthogonal to the rotational axis, each of the legs comprises at least one surface (71, 72, 75A, 75B) that is inclined with respect to a virtual radial line extending in a radial direction of the rotational axis such that it is parallel to, or coincides with, the optical axis (Xb) when at least a portion of one of the legs faces a light-receiving surface of the light-receiving device, wherein an optical axis (Xb) of the light-receiving device is inclined with respect to the virtual radial line. a rotary body adapted to rotate relative to a main body about a rotational axis, a light-emitting device provided on the rotary body, a light-receiving device provided on the rotary body, a cover disposed upward of the rotary body, and legs disposed around the rotary body and supporting the cover with respect to the main body, characterized in that (i) in a cross section orthogonal to the rotational axis, each of the legs comprises at least one surface (71, 72, 75A, 75B) that is inclined with respect to a virtual radial line extending in a radial direction of the rotational axis such that it is parallel to, or coincides with, the optical axis (Xa) when at least a portion of one of the legs faces a light-emitting surface of the light-emitting device, wherein an optical axis (Xa) of the light-emitting device is inclined with respect to the virtual radial line, and/or (ii) in a cross section orthogonal to the rotational axis, each of the legs comprises at least one surface (71, 72, 75A, 75B) that is inclined with respect to a virtual radial line extending in a radial direction of the rotational axis such that it is parallel to, or coincides with, the optical axis (Xb) when at least a portion of one of the legs faces a light-receiving surface of the light-receiving device, wherein an optical axis (Xb) of the light-receiving device is inclined with respect to the virtual radial line. (i) in a cross section orthogonal to the rotational axis, each of the legs comprises at least one surface (71, 72, 75A, 75B) that is inclined with respect to a virtual radial line extending in a radial direction of the rotational axis such that it is parallel to, or coincides with, the optical axis (Xa) when at least a portion of one of the legs faces a light-emitting surface of the light-emitting device, wherein an optical axis (Xa) of the light-emitting device is inclined with respect to the virtual radial line, and/or (ii) in a cross section orthogonal to the rotational axis, each of the legs comprises at least one surface (71, 72, 75A, 75B) that is inclined with respect to a virtual radial line extending in a radial direction of the rotational axis such that it is parallel to, or coincides with, the optical axis (Xb) when at least a portion of one of the legs faces a light-receiving surface of the light-receiving device, wherein an optical axis (Xb) of the light-receiving device is inclined with respect to the virtual radial line.