ROS2 Action Server für präzise Roboter-Bewegungen mit MIMO-PID Controller.
- motor_move_msgs: Action Message Definitions (muss zuerst gebaut werden)
- motor_move: Action Server mit MIMO-PID Controller für x, y und yaw
# Dependencies
sudo apt-get install libeigen3-dev
# Build
cd ~/ros2/your_workspace
colcon build --packages-select motor_move_msgs motor_move
source install/setup.bash
# Start
ros2 launch motor_move motor_move_launch.py namespace:=robotino1Topic: /{namespace}/motor_move_action
Type: motor_move_msgs/action/MotorMove
Goal Fields:
motor_goal: PoseStamped mit Position (x, y) und Quaternion-Orientierung
Beispiele:
Vorwärtsbewegung (1m):
ros2 action send_goal /robotino1/motor_move_action motor_move_msgs/action/MotorMove "{motor_goal: {header: {frame_id: 'robotino1/base_link'}, pose: {position: {x: 1.0, y: 0.0, z: 0.0}, orientation: {x: 0.0, y: 0.0, z: 0.0, w: 1.0}}}" --feedbackRotation um 90° (Quaternion):
ros2 action send_goal /robotino1/motor_move_action motor_move_msgs/action/MotorMove "{motor_goal: {header: {frame_id: 'robotino1/base_link'}, pose: {position: {x: 0.0, y: 0.0, z: 0.0}, orientation: {x: 0.0, y: 0.0, z: 0.707, w: 0.707}}}" --feedbackBewegung + Rotation:
ros2 action send_goal /robotino1/motor_move_action motor_move_msgs/action/MotorMove "{motor_goal: {header: {frame_id: 'robotino1/base_link'}, pose: {position: {x: 1.0, y: 0.5, z: 0.0}, orientation: {x: 0.0, y: 0.0, z: 0.382683, w: 0.92388}}}" --feedbackDatei: motor_move/config/motor_move.yaml
motor_move:
ros__parameters:
Kp: [1.8, 0.0, 0.0, 0.0, 1.8, 0.0, 0.0, 0.0, 1.8]
Ki: [0.38, 0.0, 0.0, 0.0, 0.38, 0.0, 0.0, 0.0, 0.38]
Kd: [0.2, 0.0, 0.0, 0.0, 0.2, 0.0, 0.0, 0.0, 0.2]
loop_rate: 15.0
timeout_seconds: 10.0
yaw_tolerance_degrees: 5.0
distance_tolerance: 0.05Benötigte TF2 Frames: {namespace}/odom und {namespace}/base_link
- cmd_vel (
/{namespace}/cmd_vel): Twist Messages mit Geschwindigkeitskommandos (~15 Hz) - Action Feedback:
distance_to_targetwährend der Bewegung - Action Result:
success: true/falsebei Zielerreichung, Timeout oder Fehler
ros2 launch motor_move motor_move_launch.py namespace:=robotino1
ros2 launch motor_move motor_move_launch.py namespace:=robotino2ros2 action list
ros2 action info /robotino1/motor_move_action
ros2 run tf2_tools view_frames
ros2 topic echo /robotino1/cmd_velApache 2.0 License - Copyright Carologistics