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

Testing ackermann steering controller #611

Closed
ARK3r opened this issue May 12, 2023 · 2 comments
Closed

Testing ackermann steering controller #611

ARK3r opened this issue May 12, 2023 · 2 comments

Comments

@ARK3r
Copy link
Contributor

ARK3r commented May 12, 2023

So I'm trying to test the Ackermann Steering Controller that is currently being worked on to get merged.

I built a repo with the hardware_interface and the urdf description of an Ackermann robot (f1tenth).

Everything is set up but I am running into an issue. This is my first time setting up ros2_control for a robot, so I feel lost as to how I could resolve the problem.

In this repo there is info regarding how to reproduce my docker environment.

I believe the issue is that the "front wheel joints" (continuous) which are connected to the "steering hinges" (revolute) are not registered to the Ackermann controller so their transformations aren't published. Not sure that's the issue though. Nonetheless, the front wheels aren't showing up in the rviz.

Screenshot from 2023-05-12 12-38-56

Any suggestions as to what I need to do?

@ARK3r
Copy link
Contributor Author

ARK3r commented May 15, 2023

Just to provide more info, this is the output I'm getting from running sim.launch.py:

root@reza:/ros2_ws# ros2 launch f1tenth_hardware_interface sim.launch.py 
[INFO] [launch]: All log files can be found below /root/.ros/log/2023-05-15-15-14-49-066357-reza-opti-112
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [ros2_control_node-1]: process started with pid [117]
[INFO] [robot_state_publisher-2]: process started with pid [119]
[INFO] [spawner-3]: process started with pid [121]
[robot_state_publisher-2] [INFO] [1684163689.499421405] [robot_state_publisher]: got segment base_link
[robot_state_publisher-2] [INFO] [1684163689.499491414] [robot_state_publisher]: got segment chassis
[robot_state_publisher-2] [INFO] [1684163689.499497134] [robot_state_publisher]: got segment chassis_inertia
[robot_state_publisher-2] [INFO] [1684163689.499499763] [robot_state_publisher]: got segment left_front_wheel
[robot_state_publisher-2] [INFO] [1684163689.499501965] [robot_state_publisher]: got segment left_rear_wheel
[robot_state_publisher-2] [INFO] [1684163689.499504116] [robot_state_publisher]: got segment left_steering_hinge
[robot_state_publisher-2] [INFO] [1684163689.499506286] [robot_state_publisher]: got segment right_front_wheel
[robot_state_publisher-2] [INFO] [1684163689.499508589] [robot_state_publisher]: got segment right_rear_wheel
[robot_state_publisher-2] [INFO] [1684163689.499510678] [robot_state_publisher]: got segment right_steering_hinge
[ros2_control_node-1] [INFO] [1684163689.533249734] [resource_manager]: Loading hardware 'f1tenth' 
[ros2_control_node-1] [INFO] [1684163689.534569860] [resource_manager]: Initialize hardware 'f1tenth' 
[ros2_control_node-1] [INFO] [1684163689.534701765] [F1TENTHSystemHardware]: F1TENTHSystemHardware interface has 4 joints
[ros2_control_node-1] [INFO] [1684163689.534736785] [F1TENTHSystemHardware]: Joint 'left_rear_wheel_joint' has 1 command interfaces and 2 state interfaces and they are as follows:
[ros2_control_node-1] [INFO] [1684163689.534740521] [F1TENTHSystemHardware]: Command interface 0: velocity
[ros2_control_node-1] [INFO] [1684163689.534742742] [F1TENTHSystemHardware]: State interface 0: position
[ros2_control_node-1] [INFO] [1684163689.534744478] [F1TENTHSystemHardware]: State interface 1: velocity
[ros2_control_node-1] [INFO] [1684163689.534746663] [F1TENTHSystemHardware]: Joint 'right_rear_wheel_joint' has 1 command interfaces and 2 state interfaces and they are as follows:
[ros2_control_node-1] [INFO] [1684163689.534748505] [F1TENTHSystemHardware]: Command interface 0: velocity
[ros2_control_node-1] [INFO] [1684163689.534750061] [F1TENTHSystemHardware]: State interface 0: position
[ros2_control_node-1] [INFO] [1684163689.534751534] [F1TENTHSystemHardware]: State interface 1: velocity
[ros2_control_node-1] [INFO] [1684163689.534752992] [F1TENTHSystemHardware]: Joint 'left_steering_hinge_joint' has 1 command interfaces and 1 state interfaces and they are as follows:
[ros2_control_node-1] [INFO] [1684163689.534754621] [F1TENTHSystemHardware]: Command interface 0: position
[ros2_control_node-1] [INFO] [1684163689.534756080] [F1TENTHSystemHardware]: State interface 0: position
[ros2_control_node-1] [INFO] [1684163689.534757554] [F1TENTHSystemHardware]: Joint 'right_steering_hinge_joint' has 1 command interfaces and 1 state interfaces and they are as follows:
[ros2_control_node-1] [INFO] [1684163689.534759127] [F1TENTHSystemHardware]: Command interface 0: position
[ros2_control_node-1] [INFO] [1684163689.534760579] [F1TENTHSystemHardware]: State interface 0: position
[ros2_control_node-1] [INFO] [1684163689.534766290] [resource_manager]: Successful initialization of hardware 'f1tenth'
[ros2_control_node-1] [WARN] [1684163689.535000006] [controller_manager]: [Deprecated]: Automatic activation of all hardware components will not be supported in the future anymore. Use hardware_spawner instead.
[ros2_control_node-1] [INFO] [1684163689.535088243] [resource_manager]: 'configure' hardware 'f1tenth' 
[ros2_control_node-1] [INFO] [1684163689.535097174] [resource_manager]: Successful 'configure' of hardware 'f1tenth'
[ros2_control_node-1] [INFO] [1684163689.535105776] [resource_manager]: 'activate' hardware 'f1tenth' 
[ros2_control_node-1] [INFO] [1684163689.535108944] [F1TENTHSystemHardware]: Activating ...please wait...
[ros2_control_node-1] [INFO] [1684163689.535110942] [F1TENTHSystemHardware]: Activated.
[ros2_control_node-1] [INFO] [1684163689.535113250] [resource_manager]: Successful 'activate' of hardware 'f1tenth'
[ros2_control_node-1] [INFO] [1684163689.540076751] [controller_manager]: update rate is 10 Hz
[ros2_control_node-1] [INFO] [1684163689.540196844] [controller_manager]: RT kernel is recommended for better performance
[ros2_control_node-1] [INFO] [1684163689.968315617] [controller_manager]: Loading controller 'joint_state_broadcaster'
[spawner-3] [INFO] [1684163690.041090154] [spawner_joint_state_broadcaster]: Loaded joint_state_broadcaster
[ros2_control_node-1] [INFO] [1684163690.041877790] [controller_manager]: Configuring controller 'joint_state_broadcaster'
[ros2_control_node-1] [INFO] [1684163690.042104101] [joint_state_broadcaster]: 'joints' or 'interfaces' parameter is empty. All available state interfaces will be published
[spawner-3] [INFO] [1684163690.241211594] [spawner_joint_state_broadcaster]: Configured and activated joint_state_broadcaster
[INFO] [spawner-3]: process has finished cleanly [pid 121]
[INFO] [spawner-4]: process started with pid [211]
[INFO] [rviz2-5]: process started with pid [213]
[rviz2-5] QStandardPaths: wrong permissions on runtime directory /tmp, 0777 instead of 0700
[rviz2-5] [INFO] [1684163690.731170276] [rviz2]: Stereo is NOT SUPPORTED
[rviz2-5] [INFO] [1684163690.731350366] [rviz2]: OpenGl version: 4.6 (GLSL 4.6)
[rviz2-5] [INFO] [1684163690.836750694] [rviz2]: Stereo is NOT SUPPORTED
[ros2_control_node-1] [INFO] [1684163690.870720685] [controller_manager]: Loading controller 'ackermann_steering_controller'
[spawner-4] [INFO] [1684163690.941259380] [spawner_ackermann_steering_controller]: Loaded ackermann_steering_controller
[ros2_control_node-1] [INFO] [1684163690.942066500] [controller_manager]: Configuring controller 'ackermann_steering_controller'
[ros2_control_node-1] [INFO] [1684163690.942206850] [ackermann_steering_controller]: ackermann odom configure successful
[ros2_control_node-1] [INFO] [1684163690.946449346] [ackermann_steering_controller]: configure successful
[spawner-4] [INFO] [1684163691.141320540] [spawner_ackermann_steering_controller]: Configured and activated ackermann_steering_controller
[INFO] [spawner-4]: process has finished cleanly [pid 211]

and this is what rviz looks like:
Screenshot from 2023-05-15 11-16-44

@ARK3r
Copy link
Contributor Author

ARK3r commented May 17, 2023

So those last issues were resolved, now I'm running into the following concern:

Sending twist commands using rqt will have the steering joints to rotate continuously. With some searching I find this older piece of code. Could I possibly manually enforce the joint limits inside read or write?

You can also reproduce the problem using the sim.launch.py here and sending steering commands using rqt.

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

1 participant