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 (CX), 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 (CX), each of the legs comprises at least one surface that is inclined with respect to a virtual radial line (RL) extending in a radial direction of the rotational axis (CX) 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 (RL), and/or (ii) in a cross section orthogonal to the rotational axis (CX), each of the legs comprises at least one surface that is inclined with respect to a virtual radial line (RL) extending in a radial direction of the rotational axis (CX) 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 (RL). a rotary body adapted to rotate relative to a main body about a rotational axis (CX), 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 (CX), each of the legs comprises at least one surface that is inclined with respect to a virtual radial line (RL) extending in a radial direction of the rotational axis (CX) 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 (RL), and/or (ii) in a cross section orthogonal to the rotational axis (CX), each of the legs comprises at least one surface that is inclined with respect to a virtual radial line (RL) extending in a radial direction of the rotational axis (CX) 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 (RL). (i) in a cross section orthogonal to the rotational axis (CX), each of the legs comprises at least one surface that is inclined with respect to a virtual radial line (RL) extending in a radial direction of the rotational axis (CX) 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 (RL), and/or (ii) in a cross section orthogonal to the rotational axis (CX), each of the legs comprises at least one surface that is inclined with respect to a virtual radial line (RL) extending in a radial direction of the rotational axis (CX) 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 (RL). <EOS>