Method for assembling a camera (100, 1000) comprising a sensor (200, 2000), a lens (300, 3000), and a housing (110, 1100) arranged to hold the sensor, the method comprising: attaching at least one of the sensor and the lens to a carrier (210, 2100, 310), adjusting a position of at least one of the sensor and the lens such that the sensor is positioned at a predetermined angle in relation to an optical axis of the lens, and, before the step of adjusting: arranging at least one connection plate (410, 610a) in a retainer (700, 7000, 800, 900) such that an opening (710, 7100, 810, 910) in the retainer is aligned with an opening of the at least one connection plate, and attaching the retainer to the carrier such that the opening of the retainer is aligned with an opening in the carrier, inserting a first end of a peg in the opening of the at least one connection plate, in the opening in the carrier, and in the opening of the retainer, the peg extending in a direction parallel to the optical axis of the lens, and a second end of the peg being attached to the housing, the method further comprising, after the step of adjusting: laser welding the at least one of the sensor carrier and the lens carrier in relation to the housing such that the sensor and the lens are fixed in relation to each other wherein the step of laser welding comprises laser welding the at least one connection plate to at least one of the peg and the retainer. attaching at least one of the sensor and the lens to a carrier (210, 2100, 310), adjusting a position of at least one of the sensor and the lens such that the sensor is positioned at a predetermined angle in relation to an optical axis of the lens, and, before the step of adjusting: arranging at least one connection plate (410, 610a) in a retainer (700, 7000, 800, 900) such that an opening (710, 7100, 810, 910) in the retainer is aligned with an opening of the at least one connection plate, and attaching the retainer to the carrier such that the opening of the retainer is aligned with an opening in the carrier, arranging at least one connection plate (410, 610a) in a retainer (700, 7000, 800, 900) such that an opening (710, 7100, 810, 910) in the retainer is aligned with an opening of the at least one connection plate, and attaching the retainer to the carrier such that the opening of the retainer is aligned with an opening in the carrier, inserting a first end of a peg in the opening of the at least one connection plate, in the opening in the carrier, and in the opening of the retainer, the peg extending in a direction parallel to the optical axis of the lens, and a second end of the peg being attached to the housing, the method further comprising, after the step of adjusting: laser welding the at least one of the sensor carrier and the lens carrier in relation to the housing such that the sensor and the lens are fixed in relation to each other wherein the step of laser welding comprises laser welding the at least one connection plate to at least one of the peg and the retainer. laser welding the at least one of the sensor carrier and the lens carrier in relation to the housing such that the sensor and the lens are fixed in relation to each other wherein the step of laser welding comprises laser welding the at least one connection plate to at least one of the peg and the retainer.