ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Best practices for system design and package dependencies

asked 2022-12-30 09:45:53 -0500

sameh4 gravatar image

My questions is based on lack of experience in the overall robot system design process. I have practiced all the pieces very often, like nodes ( publishers and subscribers) as well as actions and services. I also used many off the shelf packages like ros2 control and nav2 to move both physical robots and in Gazebo.

However I lack experience in designing an entire robot and its packages from scratch. So I am using the duckietown chassis and peripherals but writing everything in ros2 c++ rather than neotic python as is being used by the course

So far I have two packages: a sensors package and a control package.

  • Sensor Package: the purpose here is to group together any kind of hardware interfaces, like wheel encoders, motor drivers, camera nodes, etc. This package understands things like PWM and I2C and can communicate with the GPIO.

  • Control Package: this package will use classes and nodes from the sensor package to drive the wheels. I plan to add PID feedback later on, but for now the purpose to just drive the wheels with teleop or teleop_joy for instance.

I started to think about this in terms of having two teams: one team is writing the controls package, while another team is writing the sensors (essentially drivers). The control engineers don't want to know or understand anything about PWM or I2C for instance.

Therefore it does not make sense for the sensors package to offer any utilities, but just interfaces through messages.

Thus the sensors package needs to offer services and actions for initializing things like I2C or GPIO.

But I want to pause and think about this design so that it is long-term-thinking.

For instance this robot will end up with a perception package and a planning package as well. Therefore there must be some kind of orchestration package (probably just a set of launch files) that would initialize all this.

I suppose my real question is: how is this done in professional large scale projects? What is the best practice for package dependencies and overall system design, as well as system bring-up?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2022-12-30 10:20:43 -0500

ljaniec gravatar image

This is not the answer, but I can give you some examples of projects I know of that you can base your work on:

Of course, your final decision depends on many factors, so I'd love to see other suggestions.

edit flag offensive delete link more

Comments

@ljaniec thanks for the links! The turtlebot3 is an interesting use case. They have a kind of "main" node that creates objects that manage sensors and actuators, and passes a handle of itself to them. It also uses an "sdk" for controlling the actual peripherals by doing the lower level code, i2c, etc.

sameh4 gravatar image sameh4  ( 2022-12-30 12:27:20 -0500 )edit

Question Tools

3 followers

Stats

Asked: 2022-12-30 09:45:53 -0500

Seen: 261 times

Last updated: Dec 30 '22