r/ControlTheory 4d ago

Educational Advice/Question ROS and control systems

I am new to ROS and have experience developing control systems on microcontrollers. When I looked at using a Jetson Nano for perception and path planning, I wanted to know if controls are implemented on it as well. I don't see a lot of resources where control systems are implemented on NVIDIA boards. Can custom control loops and algorithms be implemented using ROS running on Jetson boards or on GPUs in particular? Can ROS be used on these boards for perception, planning and controls? Can the things that I typically do on a MCU such as math for optimization, filtering etc. be done on a Jetson board? Is it the same as writing a C/C++ code or do I have to learn CUDA programming?

26 Upvotes

11 comments sorted by

u/TheDiBZ 4d ago

ROS is pretty popular in robotics and applied controls. iirc ROS requires an underlying operating system like Ubuntu, which i’m pretty sure Jetson boards normally come installed with. ROS is great because it provides a pub/sub messaging system and has tons of support for micro controller bridging with tools like MicroXRCEDDS. normally it’s done with just C/C++ and the ROS machine is usually used for the high computation tasks like optimization and filtering, while the micro controller handles the stuff that needs low latency like control loop math, actuators, sensors etc. control loops can also be done on the ROS machine.

not an expert by any means so take my words with a grain of salt

u/lizardhistorian 4d ago edited 4d ago

Pub/sub is second greatest mistake in ROS after DDS.
The appropriate architecture is pin-and-filter-graph, like Simulink or LabVIEW, et. al.

The introduction of pub/sub at this level is like a front-end dev tried to do robotics.

DDS is barely usable and a constant source of problems.
It should have been a dumb local-multicast protocol.

We need to move point-clouds and images around and ROS just chokes and dies on it.

u/TheDiBZ 4d ago

what is the reasoning behind this? i work on drones this is kind of the standard

u/iluvdennys 2d ago

My group uses ros2 on a jetson, we bridge the ros2 topics to a separate computer running higher rate controllers using dds. This is perfect for us since our work revolves around controlling at a higher level and putting more clams into trajectory optimization among other optimization problems, so we can just use ros2 and python easily

u/christopherpacheco 4d ago

For basic robots with not super fast (above 1kHz control loops) or hard constraints. Ros2 control can get the job mostly done for 90% of the needs. Look at the hardware interfaces and built in controllers like diff drive, linear axis, robot joints, etc

u/BashfulPiggy 4d ago

There's lots of ways to implement ROS control loops. You can, as you stated, write the code for the control loop yourself. You could also use pre built libraries like ros_control or prox_mpc. Or you could develop custom controller on a platform like matlab and deploy them as ros nodes.

u/blazing_cannon 4d ago

Awesome. So you're saying, I can implement perception and computer vision , planning and controls (like RL and MRAC, other non linear controls which are complex . not like PID, LQR) all on a Jetson board?

u/lizardhistorian 4d ago

It is readily available for download from nVidia and StereoLabs and other vendors.

Infinite-horizon LQR is the typical base algorithm for simple steering control.

u/Timely-Bicycle-3107 4d ago

RL might be tough. You probably won't be able to store too much data for batch training, especially if the training data includes images/video for perception. Are you planning on training the RL agent on the physical board? If so, what are you including in your state definition? What agent are you using, and what is the application? I only ask because this information is helpful for determining computing cost.

u/lizardhistorian 4d ago edited 4d ago

It is all a question of "granularity" and performance (as in achieving the goal not fast.)

Your inner most loops need dedicated microcontrollers or they will run poorly and impact performance.
This is your "BKit", or drive-by-wire kit.

You can make a simple AKit (autonomy-kit) on the Orin NX hardware. The next generation of Orin should be "the one" that takes off and people really start using. Right now you would probably need two Orin NX's or maybe three for a full system.

Their AGX platforms are kinda trash. I do not know why but nothing ever works properly on them and their software release pace and bug-fix pace are glacial. We are about four years ahead of them and our team is eight people. When Tesla eval'd the AGX platform they made the decision to design their own chip and system.

While technically "a board" these powerful SoC based systems are not like an embedded board and we do not refer to them like that. They run an entire Linux system and the purpose of making them run Ubuntu is to make it easy to run ROS - otherwise we would run Yocto or something else on them.

Lots of companies sell tools and systems and sensors based around these devices.

u/Critical_Archer_555 4d ago

A Linux preemptible RT kernel (PREEMPT_RT) is relatively good for tasks up to 1kHz+. It allows for most tasks to be accomplished using C/C++ with relative ease. There is a NASA paper which defines the worst case timings. You could possibly get around ROS-based environments. I won’t add the link here as I am not sure of subreddit rules but if you look up “preempt Linux kernel” it should point to the official Linux docs.