clubcapra / markhor

🐐 Capra-Markhor is a ROS-based solution for managing and operating Club Capra's second rescue robot. 🐐
9 stars 1 forks source link

Refactor repetitive code inside markhor_hw_interface_flippers.cpp #22

Open lvanasse opened 2 years ago

lvanasse commented 2 years ago

Inside : markhor_hw_interface_flippers.cpp

There's a lot of repeated logic that's pretty much identical for all the drives. For examples, things like printing the state of the drive or initializing the drive. All drives also have an upper/lower limit. I think this shows there's a missing abstraction that wraps the drive in a structure containing the pointer to the drive and the associated limits. Once you have that structure, it would also be much easier to just extract shared code like initializing and printing the state.

_Originally posted by @IceSentry in https://github.com/clubcapra/markhor/pull/21#discussion_r739869643_