0
$\begingroup$

"I've already installed the necessary packages for the robot operation and completed the setup in the launch file. However, whenever I run the launch file, the joystick doesn't seem to work, and the controller isn't functioning, causing the robot model not to operate. How can I resolve this? so I use ROS2 humble

Referencing this URL: https://www.youtube.com/watchv=4QKsDf1c4hc&list=PLunhqkrRNRhYAffV8JDiFOatQXuU-NnxT&index=12

When I execute 'ros2 launch articubot_one launch_sim.launch.py world:=src/articubot_one/worlds//obstacles.world', the following events occur."

[INFO] [launch]: All log files can be found below /home/hoonle/.ros/log/2023-12-18-22-28-59-263908-hoonle135-12482 [INFO] [launch]: Default logging verbosity is set to INFO [INFO] [robot_state_publisher-1]: process started with pid [12484] [INFO] [joy_node-2]: process started with pid [12486] [INFO] [teleop_node-3]: process started with pid [12488] [INFO] [twist_mux-4]: process started with pid [12490] [INFO] [gzserver-5]: process started with pid [12492] [INFO] [gzclient-6]: process started with pid [12495] [INFO] [spawn_entity.py-7]: process started with pid [12498] [INFO] [spawner-8]: process started with pid [12506] [INFO] [spawner-9]: process started with pid [12512] [teleop_node-3] [INFO] [1702906145.170786454] [TeleopTwistJoy]: Teleop enable button 6. [teleop_node-3] [INFO] [1702906145.183447953] [TeleopTwistJoy]: Turbo on button 7. [teleop_node-3] [INFO] [1702906145.183529894] [TeleopTwistJoy]: Linear axis x on 1 at scale 0.500000. [teleop_node-3] [INFO] [1702906145.183708446] [TeleopTwistJoy]: Turbo for linear axis x is scale 1.000000. [teleop_node-3] [INFO] [1702906145.183757644] [TeleopTwistJoy]: Angular axis yaw on 0 at scale 0.500000. [teleop_node-3] [INFO] [1702906145.183791701] [TeleopTwistJoy]: Turbo for angular axis yaw is scale 1.000000. [robot_state_publisher-1] [INFO] [1702906145.884653768] [robot_state_publisher]: got segment base_footprint [robot_state_publisher-1] [INFO] [1702906145.885164739] [robot_state_publisher]: got segment base_link [robot_state_publisher-1] [INFO] [1702906145.885215727] [robot_state_publisher]: got segment camera_link [robot_state_publisher-1] [INFO] [1702906145.885238465] [robot_state_publisher]: got segment camera_link_optical [robot_state_publisher-1] [INFO] [1702906145.885260016] [robot_state_publisher]: got segment caster_wheel [robot_state_publisher-1] [INFO] [1702906145.885280587] [robot_state_publisher]: got segment chassis [robot_state_publisher-1] [INFO] [1702906145.885301213] [robot_state_publisher]: got segment face_link [robot_state_publisher-1] [INFO] [1702906145.885320870] [robot_state_publisher]: got segment laser_frame [robot_state_publisher-1] [INFO] [1702906145.885340244] [robot_state_publisher]: got segment left_wheel [robot_state_publisher-1] [INFO] [1702906145.885359744] [robot_state_publisher]: got segment right_wheel [twist_mux-4] [INFO] [1702906145.985599794] [twist_mux]: Topic handler 'topics.joystick' subscribed to topic 'cmd_vel_joy': timeout = 0.500000s , priority = 100. [twist_mux-4] [INFO] [1702906146.031988853] [twist_mux]: Topic handler 'topics.navigation' subscribed to topic 'cmd_vel': timeout = 0.500000s , priority = 10. [twist_mux-4] [INFO] [1702906146.057723243] [twist_mux]: Topic handler 'topics.tracker' subscribed to topic 'cmd_vel_tracker': timeout = 0.500000s , priority = 20. [joy_node-2] [INFO] [1702906148.870057931] [joy_node]: Opened joystick: Xbox 360 Controller. deadzone: 0.050000 [spawner-8] [INFO] [1702906151.209195415] [spawner_diff_cont]: Waiting for '/controller_manager' node to exist [spawner-9] [INFO] [1702906152.262984379] [spawner_joint_broad]: Waiting for '/controller_manager' node to exist [spawn_entity.py-7] [INFO] [1702906152.431985994] [spawn_entity]: Spawn Entity started [spawn_entity.py-7] [INFO] [1702906152.435572264] [spawn_entity]: Loading entity published on topic robot_description [spawn_entity.py-7] /opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/qos.py:307: UserWarning: DurabilityPolicy.RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL is deprecated. Use DurabilityPolicy.TRANSIENT_LOCAL instead. [spawn_entity.py-7] warnings.warn( [spawn_entity.py-7] [INFO] [1702906152.462296407] [spawn_entity]: Waiting for entity xml on robot_description [spawn_entity.py-7] [INFO] [1702906152.483177278] [spawn_entity]: Waiting for service /spawn_entity, timeout = 30 [spawn_entity.py-7] [INFO] [1702906152.488030881] [spawn_entity]: Waiting for service /spawn_entity [spawner-8] [INFO] [1702906153.253201370] [spawner_diff_cont]: Waiting for '/controller_manager' node to exist [spawner-9] [INFO] [1702906154.329643129] [spawner_joint_broad]: Waiting for '/controller_manager' node to exist [spawner-8] [INFO] [1702906155.333745837] [spawner_diff_cont]: Waiting for '/controller_manager' node to exist [spawn_entity.py-7] [INFO] [1702906156.038646357] [spawn_entity]: Calling service /spawn_entity [spawner-9] [INFO] [1702906156.505024238] [spawner_joint_broad]: Waiting for '/controller_manager' node to exist [spawner-8] [INFO] [1702906157.374522076] [spawner_diff_cont]: Waiting for '/controller_manager' node to exist [gzserver-5] [INFO] [1702906158.511504720] [camera_controller]: Publishing camera info to [/camera/camera_info] [spawner-9] [INFO] [1702906158.552936132] [spawner_joint_broad]: Waiting for '/controller_manager' node to exist [gzserver-5] [WARN] [1702906158.714900027] [rcl]: Found remap rule '~/out:=scan'. This syntax is deprecated. Use '--ros-args --remap ~/out:=scan' instead. [spawn_entity.py-7] [INFO] [1702906158.786377944] [spawn_entity]: Spawn status: SpawnEntity: Successfully spawned entity [my_bot] [spawner-8] [ERROR] [1702906158.918843418] [spawner_diff_cont]: Controller manager not available [gzserver-5] [WARN] [1702906159.092505281] [rcl]: Found remap rule '~/out:=scan'. This syntax is deprecated. Use '--ros-args --remap ~/out:=scan' instead. [gzserver-5] [INFO] [1702906159.631869569] [gazebo_ros2_control]: Loading gazebo_ros2_control plugin [spawner-9] [ERROR] [1702906159.804731038] [spawner_joint_broad]: Controller manager not available [INFO] [spawn_entity.py-7]: process has finished cleanly [pid 12498] [gzserver-5] [INFO] [1702906160.131269697] [gazebo_ros2_control]: Starting gazebo_ros2_control plugin in namespace: / [gzserver-5] [INFO] [1702906160.134292559] [gazebo_ros2_control]: Starting gazebo_ros2_control plugin in ros 2 node: gazebo_ros2_control [gzserver-5] [INFO] [1702906160.137459190] [gazebo_ros2_control]: Loading parameter files /home/hoonle/dev_ws/install/articubot_one/share/articubot_one/config/my_controllers.yaml [gzserver-5] [INFO] [1702906160.142078293] [gazebo_ros2_control]: Loading parameter files /home/hoonle/dev_ws/install/articubot_one/share/articubot_one/config/gaz_ros2_ctl_use_sim.yaml [gzserver-5] [INFO] [1702906160.407563766] [gazebo_ros2_control]: connected to service!! robot_state_publisher [gzserver-5] [INFO] [1702906160.413188506] [gazebo_ros2_control]: Received urdf from param server, parsing... [ERROR] [spawner-8]: process has died [pid 12506, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner diff_cont --ros-args']. [gzserver-5] [INFO] [1702906160.616743943] [gazebo_ros2_control]: Loading joint: left_wheel_joint [gzserver-5] [INFO] [1702906160.617521531] [gazebo_ros2_control]: State: [gzserver-5] [INFO] [1702906160.617592564] [gazebo_ros2_control]: velocity [gzserver-5] [INFO] [1702906160.617631934] [gazebo_ros2_control]: position [gzserver-5] [INFO] [1702906160.617663410] [gazebo_ros2_control]: Command: [gzserver-5] [INFO] [1702906160.617726429] [gazebo_ros2_control]: velocity [gzserver-5] [INFO] [1702906160.617767571] [gazebo_ros2_control]: Loading joint: right_wheel_joint [gzserver-5] [INFO] [1702906160.617797019] [gazebo_ros2_control]: State: [gzserver-5] [INFO] [1702906160.617822631] [gazebo_ros2_control]: velocity [gzserver-5] [INFO] [1702906160.617848121] [gazebo_ros2_control]: position [gzserver-5] [INFO] [1702906160.617872919] [gazebo_ros2_control]: Command: [gzserver-5] [INFO] [1702906160.619132016] [gazebo_ros2_control]: velocity [gzserver-5] [INFO] [1702906160.619361862] [resource_manager]: Initialize hardware 'GazeboSystem' [gzserver-5] [INFO] [1702906160.621804402] [resource_manager]: Successful initialization of hardware 'GazeboSystem' [gzserver-5] [INFO] [1702906160.622799508] [resource_manager]: 'configure' hardware 'GazeboSystem' [gzserver-5] [INFO] [1702906160.622846051] [resource_manager]: Successful 'configure' of hardware 'GazeboSystem' [gzserver-5] [INFO] [1702906160.622867518] [resource_manager]: 'activate' hardware 'GazeboSystem' [gzserver-5] [INFO] [1702906160.622886590] [resource_manager]: Successful 'activate' of hardware 'GazeboSystem' [gzserver-5] [INFO] [1702906160.625476274] [gazebo_ros2_control]: Loading controller_manager [gzserver-5] [INFO] [1702906160.913622535] [controller_manager]: Subscribing to '~/robot_description' topic for robot description file. [ERROR] [spawner-9]: process has died [pid 12512, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner joint_broad --ros-args']. [gzserver-5] [WARN] [1702906161.118151328] [gazebo_ros2_control]: Desired controller update period (0.0333333 s) is slower than the gazebo simulation period (0.001 s). [gzserver-5] [INFO] [1702906161.121703280] [gazebo_ros2_control]: Loaded gazebo_ros2_control. [gzclient-6] context mismatch in svga_surface_destroy [gzclient-6] context mismatch in svga_surface_destroy

and my controllers yamlfile

controller_manager: ros__parameters: update_rate: 30 # use_sim_time: true

diff_cont:
  type: diff_drive_controller/DiffDriveController

joint_broad:
  type: joint_state_broadcaster/JointStateBroadcaster

diff_cont: ros__parameters:

publish_rate: 50.0

base_frame_id: base_link

left_wheel_names: ['left_wheel_joint']
right_wheel_names: ['right_wheel_joint']
wheel_separation: 0.297
wheel_radius: 0.033

use_stamped_vel: false

# open_loop: false    

# wheels_per_side: x
# wheel_separation_multiplier: x
# left_wheel_radius_multiplier: x
# right_wheel_radius_multiplier: x

# odom_frame_id: x
# pose_covariance_diagonal: x
# twist_covariance_diagonal: x
# open_loop: x
# enable_odom_tf: x

# cmd_vel_timeout: x
# publish_limited_velocity: x
# velocity_rolling_window_size: x


# linear.x.has_velocity_limits: false
# linear.x.has_acceleration_limits: false
# linear.x.has_jerk_limits: false
# linear.x.max_velocity: NAN
# linear.x.min_velocity: NAN
# linear.x.max_acceleration: NAN
# linear.x.min_acceleration: NAN
# linear.x.max_jerk: NAN
# linear.x.min_jerk: NAN

# angular.z.has_velocity_limits: false
# angular.z.has_acceleration_limits: false
# angular.z.has_jerk_limits: false
# angular.z.max_velocity: NAN
# angular.z.min_velocity: NAN
# angular.z.max_acceleration: NAN
# angular.z.min_acceleration: NAN
# angular.z.max_jerk: NAN
# angular.z.min_jerk: NAN
# joint_broad:
#   ros__parameters:

finaly my launch file

import os

from ament_index_python.packages import get_package_share_directory

from launch import LaunchDescription from launch.actions import IncludeLaunchDescription from launch.launch_description_sources import PythonLaunchDescriptionSource

from launch_ros.actions import Node

def generate_launch_description():

# Include the robot_state_publisher launch file, provided by our own package. Force sim time to be enabled
# !!! MAKE SURE YOU SET THE PACKAGE NAME CORRECTLY !!!

package_name='articubot_one' #<--- CHANGE ME

rsp = IncludeLaunchDescription(
            PythonLaunchDescriptionSource([os.path.join(
                get_package_share_directory(package_name),'launch','rsp.launch.py'
            )]), launch_arguments={'use_sim_time': 'true', 'use_ros2_control': 'true'}.items()
)

joystick = IncludeLaunchDescription(
            PythonLaunchDescriptionSource([os.path.join(
                get_package_share_directory(package_name),'launch','joystick.launch.py'
            )]), launch_arguments={'use_sim_time': 'true'}.items()
)

twist_mux_params = os.path.join(get_package_share_directory(package_name),'config','twist_mux.yaml')
twist_mux = Node(
        package="twist_mux",
        executable="twist_mux",
        parameters=[twist_mux_params, {'use_sim_time': True}],
        remappings=[('/cmd_vel_out','/diff_cont/cmd_vel_unstamped')]
    )

gazebo_params_file = os.path.join(get_package_share_directory(package_name),'config','gazebo_params.yaml')

# Include the Gazebo launch file, provided by the gazebo_ros package
gazebo = IncludeLaunchDescription(
            PythonLaunchDescriptionSource([os.path.join(
                get_package_share_directory('gazebo_ros'), 'launch', 'gazebo.launch.py')]),
                launch_arguments={'extra_gazebo_args': '--ros-args --params-file ' + gazebo_params_file}.items()
         )

# Run the spawner node from the gazebo_ros package. The entity name doesn't really matter if you only have a single robot.
spawn_entity = Node(package='gazebo_ros', executable='spawn_entity.py',
                    arguments=['-topic', 'robot_description',
                               '-entity', 'my_bot'],
                    output='screen')


diff_drive_spawner = Node(
    package="controller_manager",
    executable="spawner",
    arguments=["diff_cont"],
)

joint_broad_spawner = Node(
    package="controller_manager",
    executable="spawner",
    arguments=["joint_broad"],
)


# Code for delaying a node (I haven't tested how effective it is)
# 
# First add the below lines to imports
# from launch.actions import RegisterEventHandler
# from launch.event_handlers import OnProcessExit
#
# Then add the following below the current diff_drive_spawner
# delayed_diff_drive_spawner = RegisterEventHandler(
#     event_handler=OnProcessExit(
#         target_action=spawn_entity,
#         on_exit=[diff_drive_spawner],
#     )
# )
#
# Replace the diff_drive_spawner in the final return with delayed_diff_drive_spawner



# Launch them all!
return LaunchDescription([
    rsp,
    joystick,
    twist_mux,
    gazebo,
    spawn_entity,
    diff_drive_spawner,
    joint_broad_spawner
])

this is my list hardware interfaces

hoonle@hoonle135:~/dev_ws$ ros2 control list_hardware_interfaces
command interfaces
left_wheel_joint/velocity [available] [unclaimed]
right_wheel_joint/velocity [available] [unclaimed]
state interfaces
left_wheel_joint/position
left_wheel_joint/velocity
right_wheel_joint/position
right_wheel_joint/velocity
hoonle@hoonle135:~/dev_ws$ ros2 run controller_manager spawner.py diff_cont

No executable found

I would really appreciate your assistance. Could you please help me?

$\endgroup$
1
  • $\begingroup$ I think there's some formatting issues here: the error log doesn't have any newlines and some of your code snippets seem to not be indented correctly for formatting. Could you take a look at that so the information you're providing is clearer? $\endgroup$
    – cst0
    Dec 18, 2023 at 15:46

1 Answer 1

0
$\begingroup$

It may be an issue of topics. What topic is your controller listening to? Is it /cmd_vel? The robot and Ros_control must be in agreement here, working with the same topic name. And your teleop_twist_joy module must publish the same topic. It's easy to set in the params file.

$\endgroup$
1
  • $\begingroup$ This issue has already been resolved. Thank you for your help! $\endgroup$
    – user37765
    Dec 24, 2023 at 5:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.