This package implements different control modes for the ros2_kdl_node (standard velocity, null-space velocity, vision-based with ArUco markers) and includes an action server for executing trajectories.
Build the workspace and source the setup file before running anything:
colcon build
source install/setup.bashNote: Every new terminal must
source install/setup.bash.
Open two separate terminals: one for the simulator, one for the control node.
RViz:
ros2 launch iiwa_description aruco_gazebo.launch.py robot_controller:=velocity_controller command_interface:=velocityGazebo (with ArUco marker):
ros2 launch iiwa_description aruco_gazebo.launch.py start_rviz:=false robot_controller:=velocity_controller command_interface:=velocity use_sim:=trueLaunch the main KDL node. This node acts as an Action Server. It initializes the robot and controllers but waits for a goal before moving.
ros2 launch ros2_kdl_package ros2_kdl_node.launch.py ctrl:=velocity_ctrlros2 launch ros2_kdl_package ros2_kdl_node.launch.py ctrl:=velocity_ctrl_nullros2 launch ros2_kdl_package ros2_kdl_node.launch.py ctrl:=vision_ctrlTo execute the trajectory, launch the Action Client. This node loads the parameters from config/kdl_params.yaml and sends the goal to the server.
ros2 launch ros2_kdl_package kdl_client.launch.pyYou can modify the trajectory points and duration by editing the YAML file:
- File: src/ros2_kdl_package/config/kdl_params.yaml
- Parameters: traj_duration, end_position_x, end_position_y, end_position_z, etc.
Update ArUco marker pose:
ros2 service call /world/aruco_world/set_pose ros_gz_interfaces/srv/SetEntityPose \
"{entity: {name: 'arucotag'}, pose: {position: {x: -0.2, y: -0.73, z: 0.48}, orientation: {x: 0.0, y: 0.0, z: 0.0, w: 1.0}}}"This service can also be accessed through rqt_service_caller.