Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic system ID updates #33

Open
n-snyder opened this issue Aug 12, 2022 · 6 comments
Open

Dynamic system ID updates #33

n-snyder opened this issue Aug 12, 2022 · 6 comments

Comments

@n-snyder
Copy link
Contributor

n-snyder commented Aug 12, 2022

@murphym18, I am considering options to facilitate multiple aircraft operations. Of course, the system ID of the flight controller, MAVROS node, and gimbal should be the same for a given drone. Does the MAVROS code listen for the system ID of the flight controller in the heartbeat and update its own system ID dynamically?

@JaneClelandHuang
Copy link

JaneClelandHuang commented Aug 12, 2022

@n-snyder As our code is onboard each drone, we don't need to differentiate in the same way that QGroundControl does. Each onboard autopilot has a unique handle (e.g.,RED, BLUE) and then messages are targeted to each drone by its handle. Each onboard autopilot has one, and only one drone to control. Similarly, status is reported via unique handles. We configure these handles on each Jetson.

@JaneClelandHuang
Copy link

Accidentally closed this, from my mobile. I didn't mean to!

@murphym18
Copy link
Contributor

We can configure mavros to use a specified system ID and component ID by changing this line of the docker-compose file:

command: ["stdbuf", "-o", "L", "roslaunch", "--wait", "mavros", "px4.launch", "fcu_url:=/dev/ttyUSB0:921600"]

We can update the fcu_url parameter. For example, we could set the value to:

"fcu_url:=/dev/ttyUSB0:921600?ids=3,1"

And this would configure mavros to connect to the instance of PX4 with system id 3 and component id 1. When the ids are omitted, mavros defaults to system id 1 and component id 1.

For more detail about the mavros connection URLS, there’s a hard to find page in the mavros github repo:
https://github.com/mavlink/mavros/tree/1.13.0/mavros#connection-url

@n-snyder
Copy link
Contributor Author

Thanks. This is helpful information. I am exploring options and am not ready to test.

@JaneClelandHuang
Copy link

@murphym18 -- so I think what you are suggesting is that it would be helpful for our test environment?

@murphym18
Copy link
Contributor

I think we are better off configuring each drone so it has a unique system ID. This will give us more flexibility when flying more than one drone at a time. It's true that our system would work (theoretically) in case we reuse System ID = 1 for all instances of PX4. But the overall system might have some trouble because the mesh radio acts as a bridge between the onboard mavlink network with the wireless IP network.

If two drones have the same system ID, QGC will be glitchy. In the QGC interface we'd see the position of the drone jump rapidly from drone to drone. Also QGC might announce mode changes over and over. I've seen this when running the intel aero and a simulation at the same time.

We can address this by configuring each drone to use a unique system ID. Then we can configure mavros to match. The hardware-tests and dr_onboard should read the system ID from mavros.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants