You shouldn’t need a lambda for what you’re trying to do. The lambda expression as written essentially runs a command that creates an instance of “ShootingCommand” and then exits. If your goal is to directly run “ShootingCommand” you would want to write:
btn.whenPressed(new ShootingCommand(turret_subsystem, oi.l1(),0.8));
If the reason you are doing this is because you only want oi.l1() to be evaluated when the command actually runs, you could consider passing it in as ‘oi::l1’ instead which will pass the method into the constructor instead of the value that method takes. This is called a method reference. You can then call that method during initialize:
btn.whenPressed(new ShootingCommand(turret_subsystem, oi::l1,0.8));
Another option if method references are too daunting is to just pass oi into the command and call oi.l1() in initialize.