-
Notifications
You must be signed in to change notification settings - Fork 998
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
Cant launch composable node for mavros UAS #1977
Comments
I have the same issue. Does anyone know how to resolve this? Using composable node from libmavros or custom container node implementation including one Router and two UAS, I know that using 'ros2 component load' to load UAS comoposable node works. However it leaves plugin configuration messy and imperfect. Using launch mechanisms is much prefered. Right after launch failes, node list and topic list shows somehting like below. $ ros2 node list
WARNING: Be aware that there are nodes in the graph that share an exact name, which can have unintended side effects.
/ComponentManager
/image_container
/mavros1
/mavros1/image_container
/mavros1/image_container
/mavros1/image_container
/mavros1/image_container
/mavros1/image_container
/mavros1/image_container
/mavros1/image_container
/mavros1/image_container
/transform_listener_impl_5a6614445e58
$ ros2 topic list
/diagnostics
/mavros1/actuator_control
/mavros1/altitude
/mavros1/image_container/cam_imu_stamp
/mavros1/image_container/image_captured
/mavros1/image_container/send
/mavros1/image_container/status
/mavros1/image_container/vehicle
/mavros1/target_actuator_control
/parameter_events
/rosout
/tf
/tf_static launch.pyfrom launch import LaunchDescription
from launch_ros.actions import LoadComposableNodes, Node
from launch_ros.descriptions import ComposableNode
from launch_ros.actions import PushROSNamespace
from launch.actions import GroupAction
def generate_launch_description():
container = Node(
name='image_container',
package='rclcpp_components',
executable='component_container',
output='both',
)
pluginlists_yaml = "/opt/ros/iron/share/mavros/launch/apm_pluginlists.yaml"
config_yaml = "/opt/ros/iron/share/mavros/launch/apm_config.yaml"
params1 = {
"target_system_id": 1,
"target_component_id": 1,
"system_id": 1,
"component_id": 191,
"uas_url": "/uas1",
"log_output": "screen",
"fcu_protocol": "v2.0"
}
load_composable_nodes = LoadComposableNodes(
target_container='image_container',
composable_node_descriptions=[
ComposableNode(
package='mavros',
plugin='mavros::uas::UAS',
name='mavros1',
parameters=[params1, pluginlists_yaml, config_yaml],
),
],
)
return LaunchDescription([container,
load_composable_nodes]) Launch log[INFO] [launch]: All log files can be found below /home/nobukuni/.ros/log/2024-08-28-14-28-00-929710-kubota-dev-160842
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [component_container-1]: process started with pid [160857]
[component_container-1] [INFO] [1724822881.888900473] [image_container]: Load Library: /opt/ros/iron/lib/libmavros.so
[component_container-1] [INFO] [1724822881.911132002] [image_container]: Found class: rclcpp_components::NodeFactoryTemplate<mavros::router::Router>
[component_container-1] [INFO] [1724822881.911567730] [image_container]: Found class: rclcpp_components::NodeFactoryTemplate<mavros::uas::UAS>
[component_container-1] [INFO] [1724822881.911606401] [image_container]: Instantiate class: rclcpp_components::NodeFactoryTemplate<mavros::uas::UAS>
[INFO] [launch_ros.actions.load_composable_nodes]: Loaded node '/mavros1' in container 'image_container'
[component_container-1] [INFO] [1724822881.991150923] [mavros1]: UAS Executor started, threads: 4
[component_container-1] [INFO] [1724822882.027705973] [mavros1]: Plugin actuator_control created
[component_container-1] [INFO] [1724822882.027872018] [mavros1]: Plugin actuator_control initialized
[component_container-1] [WARN] [1724822882.048211773] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic.
[component_container-1] [INFO] [1724822882.064992758] [mavros1]: Plugin adsb created
[component_container-1] [INFO] [1724822882.065132785] [mavros1]: Plugin adsb initialized
[component_container-1] [WARN] [1724822882.065625212] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic.
[component_container-1] [INFO] [1724822882.081200521] [mavros1]: Plugin altitude created
[component_container-1] [INFO] [1724822882.081849185] [mavros1]: Plugin altitude initialized
[component_container-1] [WARN] [1724822882.083296702] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic.
[component_container-1] [INFO] [1724822882.099430909] [mavros1]: Plugin cam_imu_sync created
[component_container-1] [INFO] [1724822882.099568864] [mavros1]: Plugin cam_imu_sync initialized
[component_container-1] [WARN] [1724822882.099935698] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic.
[component_container-1] [INFO] [1724822882.119291562] [mavros1]: Plugin camera created
[component_container-1] [INFO] [1724822882.119405492] [mavros1]: Plugin camera initialized
[component_container-1] [WARN] [1724822882.119704387] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic.
[component_container-1] [INFO] [1724822882.138430293] [mavros1]: Plugin cellular_status created
[component_container-1] [INFO] [1724822882.138537973] [mavros1]: Plugin cellular_status initialized
[component_container-1] [WARN] [1724822882.138762899] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic.
[component_container-1] [INFO] [1724822882.162998144] [mavros1]: Plugin command created
[component_container-1] [INFO] [1724822882.163124715] [mavros1]: Plugin command initialized
[component_container-1] [WARN] [1724822882.163451381] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic.
[component_container-1]
[component_container-1] >>> [rcutils|error_handling.c:108] rcutils_set_error_state()
[component_container-1] This error state is being overwritten:
[component_container-1]
[component_container-1] 'create_subscription() called for existing topic name rt/mavros1/image_container/status with incompatible type mavros_msgs::msg::dds_::CompanionProcessStatus_, at ./src/subscription.cpp:517, at ./src/rcl/subscription.c:112'
[component_container-1]
[component_container-1] with this new error message:
[component_container-1]
[component_container-1] 'invalid allocator, at ./src/rcl/subscription.c:261'
[component_container-1]
[component_container-1] rcutils_reset_error() should be called after error handling to avoid this.
[component_container-1] <<<
[component_container-1] invalid allocator, at ./src/rcl/subscription.c:261
[component_container-1] terminate called after throwing an instance of 'rclcpp::exceptions::RCLError'
[component_container-1] what(): could not create subscription: invalid allocator, at ./src/rcl/subscription.c:261
[ERROR] [component_container-1]: process has died [pid 160857, exit code -6, cmd '/opt/ros/iron/lib/rclcpp_components/component_container --ros-args -r __node:=image_container']. MAVROS version and platformMavros: 2.8.0 Autopilot type and version[X] ArduPilot Version: 4.5.1 |
Issue details
Cant launch composable node for mavros UAS. Router executing normaly. But, if I use
UAS executing normaly
MAVROS version and platform
Mavros: 2.8.0
ROS: Humble
Ubuntu: 22.04
Autopilot type and version
[X] ArduPilot
[ ] PX4
Version: 4.4.0
launch.py
Node logs
The text was updated successfully, but these errors were encountered: