mavros icon indicating copy to clipboard operation
mavros copied to clipboard

How to install mavros inside the container with ros2 humble preinstalled?

Open reinzler opened this issue 1 year ago • 14 comments

Hi, how to install mavros inside the container with ros2 humble preinstalled? I tried to find an installation tutorial, but haven't managed.

Issue details

Installation support?

MAVROS version and platform

Mavros: latest? ROS2 Humble (inside NVIDIA ISAAC ROS container) Ubuntu: 20.04 NVIDIA Jetson Orin Nano

reinzler avatar Jun 08 '23 14:06 reinzler

I suppose just simple docker exec -ti ros bash and then use apt install?

vooon avatar Jun 09 '23 19:06 vooon

I suppose just simple docker exec -ti ros bash and then use apt install?

Thanks for response, but installation guidelines a for catkin, looks like for old version of ROS. Will it works with ROS2 Humble?

reinzler avatar Jun 11 '23 08:06 reinzler

https://github.com/mavlink/mavros/blob/ros2/mavros/README.md#installation

You sure?

vooon avatar Jun 12 '23 13:06 vooon

https://github.com/mavlink/mavros/blob/ros2/mavros/README.md#installation

You sure?

Thanks for response, but - E: Unable to locate package ros-humble-mavros

NatanelBirarov avatar Jun 13 '23 08:06 NatanelBirarov

You are welcome to use my container if you like: https://hub.docker.com/r/rockstarartist/mavros2

rockstarartist avatar Sep 07 '23 18:09 rockstarartist

@rockstarartist Hi, I find your container so helpful and it frees from installing everything from the beginning.

But when I begin a simulation of Ardupilot using sim_vehicle.py -v ArduCopter --console and run your container like docker run -v /dev/shm:/dev/shm --net=host rockstarartist/mavros2:humble-x86 ros2 run mavros mavros_node --ros-args -p fcu_url:=udp://:14561@localhost:5901 -p tgt_system:=1

It says ta [INFO] [1701006354.890800104] [mavros]: MAVROS UAS via /uas1 started. MY ID 1.191, TARGET ID 1.1 [INFO] [1701006355.847949284] [mavros_router]: link[1001] detected remote address 1.191 [WARN] [1701006356.855918982] [mavros.sys]: VER: broadcast request timeout, retries left 4 [WARN] [1701006357.854969064] [mavros.sys]: VER: broadcast request timeout, retries left 3 [WARN] [1701006358.854882772] [mavros.sys]: VER: unicast request timeout, retries left 2 [WARN] [1701006359.856221560] [mavros.sys]: VER: unicast request timeout, retries left 1 [WARN] [1701006360.855133240] [mavros.sys]: VER: unicast request timeout, retries left 0 [WARN] [1701006361.855991097] [mavros.sys]: VER: your FCU don't support AUTOPILOT_VERSION, switched to default capabilities

Do you know how to solve it?

ZhongmouLi avatar Nov 26 '23 13:11 ZhongmouLi

Hi!

I'll take a look at it this evening!

-Felix

On Sun, Nov 26, 2023, 8:50 AM ZhongmouLI @.***> wrote:

@rockstarartist https://github.com/rockstarartist Hi, I find your container so helpful and it frees from installing everything from the beginning.

But when I begin a simulation of Ardupilot using sim_vehicle.py -v ArduCopter --console and run your container like docker run -v /dev/shm:/dev/shm --net=host rockstarartist/mavros2:humble-x86 ros2 run mavros mavros_node --ros-args -p @.***:5901 -p tgt_system:=1

It says ta [INFO] [1701006354.890800104] [mavros]: MAVROS UAS via /uas1 started. MY ID 1.191, TARGET ID 1.1 [INFO] [1701006355.847949284] [mavros_router]: link[1001] detected remote address 1.191 [WARN] [1701006356.855918982] [mavros.sys]: VER: broadcast request timeout, retries left 4 [WARN] [1701006357.854969064] [mavros.sys]: VER: broadcast request timeout, retries left 3 [WARN] [1701006358.854882772] [mavros.sys]: VER: unicast request timeout, retries left 2 [WARN] [1701006359.856221560] [mavros.sys]: VER: unicast request timeout, retries left 1 [WARN] [1701006360.855133240] [mavros.sys]: VER: unicast request timeout, retries left 0 [WARN] [1701006361.855991097] [mavros.sys]: VER: your FCU don't support AUTOPILOT_VERSION, switched to default capabilities

Do you know how to solve it?

— Reply to this email directly, view it on GitHub https://github.com/mavlink/mavros/issues/1864#issuecomment-1826789739, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJMH2HZBXYVROFVBF5LIK3YGNCJRAVCNFSM6AAAAAAY7NG422VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRWG44DSNZTHE . You are receiving this because you were mentioned.Message ID: @.***>

rockstarartist avatar Nov 26 '23 16:11 rockstarartist

You may have your Arducopter on a different port, try changing the fcu url from 14561 to 14550 or 14551 and see if the mavros container connects.

On Sun, Nov 26, 2023, 11:23 AM RockStar Artist @.***> wrote:

Hi!

I'll take a look at it this evening!

-Felix

On Sun, Nov 26, 2023, 8:50 AM ZhongmouLI @.***> wrote:

@rockstarartist https://github.com/rockstarartist Hi, I find your container so helpful and it frees from installing everything from the beginning.

But when I begin a simulation of Ardupilot using sim_vehicle.py -v ArduCopter --console and run your container like docker run -v /dev/shm:/dev/shm --net=host rockstarartist/mavros2:humble-x86 ros2 run mavros mavros_node --ros-args -p @.***:5901 -p tgt_system:=1

It says ta [INFO] [1701006354.890800104] [mavros]: MAVROS UAS via /uas1 started. MY ID 1.191, TARGET ID 1.1 [INFO] [1701006355.847949284] [mavros_router]: link[1001] detected remote address 1.191 [WARN] [1701006356.855918982] [mavros.sys]: VER: broadcast request timeout, retries left 4 [WARN] [1701006357.854969064] [mavros.sys]: VER: broadcast request timeout, retries left 3 [WARN] [1701006358.854882772] [mavros.sys]: VER: unicast request timeout, retries left 2 [WARN] [1701006359.856221560] [mavros.sys]: VER: unicast request timeout, retries left 1 [WARN] [1701006360.855133240] [mavros.sys]: VER: unicast request timeout, retries left 0 [WARN] [1701006361.855991097] [mavros.sys]: VER: your FCU don't support AUTOPILOT_VERSION, switched to default capabilities

Do you know how to solve it?

— Reply to this email directly, view it on GitHub https://github.com/mavlink/mavros/issues/1864#issuecomment-1826789739, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJMH2HZBXYVROFVBF5LIK3YGNCJRAVCNFSM6AAAAAAY7NG422VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRWG44DSNZTHE . You are receiving this because you were mentioned.Message ID: @.***>

rockstarartist avatar Nov 26 '23 22:11 rockstarartist

@rockstarartist Hi, sorry to reply so late.

But I tried docker run -v /dev/shm:/dev/shm --net=host rockstarartist/mavros2:humble-x86 ros2 run mavros mavros_node --ros-args -p fcu_url:=udp://:14551@localhost:5901 -p tgt_system:=1 and also with 14550. Nothing works and it says

Screenshot from 2023-12-17 00-05-37

By the way, when I run sim_vehicle.py -v ArduCopter --console on my pc, there is the what shows in terminal Screenshot from 2023-12-17 00-06-48

ZhongmouLi avatar Dec 16 '23 16:12 ZhongmouLi

have you tried the following:

docker run -v /dev/shm:/dev/shm --net=host rockstarartist/mavros2:humble-x86 ros2 run mavros mavros_node --ros-args -p fcu_url:=udp://127.0.0.1:14551 -p tgt_system:=1

rockstarartist avatar Dec 17 '23 03:12 rockstarartist

H, @rockstarartist , thanks wo much for your reply.

But I still got error from your container

[INFO] [1702810594.739487662] [mavros]: MAVROS UAS via /uas1 started. MY ID 1.191, TARGET ID 1.1
[INFO] [1702810595.700723875] [mavros_router]: link[1001] detected remote address 1.191
[WARN] [1702810596.713612647] [mavros.sys]: VER: broadcast request timeout, retries left 4
[WARN] [1702810597.707605334] [mavros.sys]: VER: broadcast request timeout, retries left 3
[WARN] [1702810598.714392698] [mavros.sys]: VER: unicast request timeout, retries left 2
[WARN] [1702810599.715993658] [mavros.sys]: VER: unicast request timeout, retries left 1
[WARN] [1702810600.713304930] [mavros.sys]: VER: unicast request timeout, retries left 0
[WARN] [1702810601.713587351] [mavros.sys]: VER: your FCU don't support AUTOPILOT_VERSION, switched to default capabilities
[INFO] [1702810624.453223612] [mavros_router]: link[1000] trying to reconnect...

here is output of sim_vehicle.py

SIM_VEHICLE: Using defaults from (../Tools/autotest/default_params/copter.parm)
SIM_VEHICLE: Run ArduCopter
SIM_VEHICLE: "/home/robot/RobotFirmware/ardupilot/Tools/autotest/run_in_terminal_window.sh" "ArduCopter" "/home/robot/RobotFirmware/ardupilot/build/sitl/bin/arducopter" "-S" "--model" "+" "--speedup" "1" "--slave" "0" "--defaults" "../Tools/autotest/default_params/copter.parm" "-I0"
SIM_VEHICLE: Run MavProxy
SIM_VEHICLE: "mavproxy.py" "--out" "127.0.0.1:14550" "--out" "127.0.0.1:14551" "--master" "tcp:127.0.0.1:5760" "--sitl" "127.0.0.1:5501" "--console"
RiTW: Starting ArduCopter : /home/robot/RobotFirmware/ardupilot/build/sitl/bin/arducopter -S --model + --speedup 1 --slave 0 --defaults ../Tools/autotest/default_params/copter.parm -I0
Connect tcp:127.0.0.1:5760 source_system=255
Loaded module console
Log Directory: 
Telemetry log: mav.tlog
Waiting for heartbeat from tcp:127.0.0.1:5760
MAV> Detected vehicle 1:1 on link 0
STABILIZE> Received 1310 parameters (ftp)
Saved 1310 parameters to mav.parm

ZhongmouLi avatar Dec 17 '23 11:12 ZhongmouLi

So strange. I never really have issues connecting to the SITL. Let's try connecting it via tcp directly on the mavproxy master port.

So: docker run -v /dev/shm:/dev/shm --net=host rockstarartist/mavros2:humble-x86 ros2 run mavros mavros_node --ros-args -p fcu_url:=tcp://localhost:5760 -p tgt_system:=1

Or

docker run -v /dev/shm:/dev/shm --net=host rockstarartist/mavros2:humble-x86 ros2 run mavros mavros_node --ros-args -p fcu_url:=tcp://127.0.0.1:5760 -p tgt_system:=1

rockstarartist avatar Dec 17 '23 13:12 rockstarartist

@rockstarartist , I tried both and got the same error all the time.

I used ArduCopter 4.4.0. Is it possible that this version does not work well with mavros2?

ZhongmouLi avatar Dec 17 '23 14:12 ZhongmouLi

Ill download Arducopter 4.4.0 on to my dev machine this evening and give it a try and see where I get.

On Sun, Dec 17, 2023 at 9:58 AM ZhongmouLI @.***> wrote:

@rockstarartist https://github.com/rockstarartist , I tried both and got the same error all the time.

I used ArduCopter 4.4.0. Is it possible that this version does not work well with mavros2?

— Reply to this email directly, view it on GitHub https://github.com/mavlink/mavros/issues/1864#issuecomment-1859195073, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJMH2BIZ3G3SIL53OP5UBTYJ4CBXAVCNFSM6AAAAAAY7NG422VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJZGE4TKMBXGM . You are receiving this because you were mentioned.Message ID: @.***>

rockstarartist avatar Dec 17 '23 16:12 rockstarartist