ROS humble
I am trying on this Rpi 4B Model
ros2 launch autonomous_bot launch_robot.launch.py
[INFO] [launch]: All log files can be found below /home/rushabh/.ros/log/2024-04-18-14-09-33-038824-rushabh-Aspire-A515-57G-11932
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [robot_state_publisher-1]: process started with pid [11934]
[robot_state_publisher-1] [INFO] [1713429573.221321794] [robot_state_publisher]: got segment base_footprint
[robot_state_publisher-1] [INFO] [1713429573.221443136] [robot_state_publisher]: got segment base_link
[robot_state_publisher-1] [INFO] [1713429573.221450083] [robot_state_publisher]: got segment caster_wheel
[robot_state_publisher-1] [INFO] [1713429573.221454462] [robot_state_publisher]: got segment chassis
[robot_state_publisher-1] [INFO] [1713429573.221458020] [robot_state_publisher]: got segment laser_frame
[robot_state_publisher-1] [INFO] [1713429573.221461770] [robot_state_publisher]: got segment left_wheel
[robot_state_publisher-1] [INFO] [1713429573.221465416] [robot_state_publisher]: got segment right_wheel
[INFO] [ros2_control_node-2]: process started with pid [11969]
[INFO] [spawner-3]: process started with pid [11971]
[INFO] [spawner-4]: process started with pid [11973]
[ros2_control_node-2] [INFO] [1713429577.313543564] [controller_manager]: Subscribing to '~/robot_description' topic for robot description file.
[ros2_control_node-2] [INFO] [1713429577.314012686] [controller_manager]: update rate is 50 Hz
[ros2_control_node-2] [INFO] [1713429577.314141952] [controller_manager]: RT kernel is recommended for better performance
[spawner-4] [INFO] [1713429579.557576828] [spawner_diff_cont]: Waiting for '/controller_manager' services to be available
[spawner-3] [INFO] [1713429579.557659421] [spawner_joint_board]: Waiting for '/controller_manager' services to be available
[spawner-4] [INFO] [1713429581.577298020] [spawner_diff_cont]: Waiting for '/controller_manager' services to be available
[spawner-3] [INFO] [1713429581.579662994] [spawner_joint_board]: Waiting for '/controller_manager' services to be available
Launch File:
import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription, TimerAction
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import Command
from launch.actions import RegisterEventHandler
from launch.event_handlers import OnProcessStart
from launch_ros.actions import Node
def generate_launch_description():
package_name='autonomous_bot' #<--- CHANGE ME
rsp = IncludeLaunchDescription(
PythonLaunchDescriptionSource([os.path.join(
get_package_share_directory(package_name),'launch','rsp.launch.py'
)]), launch_arguments={'use_sim_time': 'false','use_ros2_control': 'true'}.items()
)
robot_description = Command(['ros2 param get --hide-type /robot_state_publisher robot_description'])
controller_params_file = os.path.join(get_package_share_directory(package_name),'config','my_controller.yaml')
controller_manager = Node(
package="controller_manager",
executable="ros2_control_node",
parameters=[{'robot_state_publisher': robot_description},
controller_params_file]
)
delayed_controller_manager = TimerAction(period=3.0, actions=[controller_manager])
diff_drive_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["diff_cont"],
)
delayed_diff_drive_spawner = RegisterEventHandler(
event_handler=OnProcessStart(
target_action=controller_manager,
on_start=[diff_drive_spawner],
)
)
joint_broad_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["joint_board"],
)
delayed_joint_broad_spawner = RegisterEventHandler(
event_handler=OnProcessStart(
target_action=controller_manager,
on_start=[joint_broad_spawner],
)
)
return LaunchDescription([
rsp,
delayed_controller_manager,
delayed_diff_drive_spawner,
delayed_joint_broad_spawner
])