how do you create a group of joints for MoveIt Planning Group for a custom robot
Hi everyone, first time posting.
My question relates to my attempt at creating a custom robot from scratch and trying to control it using MoveIt. I reverse engineered a model for an existing toy robot here. I also modify the arm to include encoders which are read by a Particle Photon micro and feed into my ROS controller node via RS232. I would post my URDF but i cant attach files yet, it took many hours to design the robot using SolidWorks and its URDF exporter (Note: pretty cool program)
I followed this example to get my arm working, I can send joint position targets using this command
~/catkin_ws$ rostopic pub /myrobot/joint_1/command std_msgs/Float64 -- -0.2
The above successfully drives joint 1 to the required angle.
/myrobot/launch/robot_position_controllers.launch
<?xml version="1.0"?>
<launch>
<rosparam file="$(find myrobot)/config/hardware.yaml" command="load"/>
<rosparam file="$(find myrobot)/config/ros_controllers.yaml" command="load"/>
<rosparam file="$(find myrobot)/config/joint_limits.yaml" command="load"/>
<param name="robot_description" textfile="$(find robotarm_individual)/urdf/robotarm_individual.urdf" />
<node name="myrobot_node" pkg="myrobot" type="myrobot_node" output="screen" />
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" />
<node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false" output="screen"
args="joint_state_controller myrobot/joint_1 myrobot/joint_2 myrobot/joint_3 myrobot/joint_4 "/>
</launch>
/myrobot/config/hardward.yaml
myrobot:
hardware_interface:
loop_hz: 10 # hz
joints:
- jt1_joint
- jt2_joint
- jt3_joint
- jt4_joint
- jt5_joint
/myrobot/config/jointlimits.yaml
joint_limits:
jt1_joint:
has_position_limits: true
min_position: -2.22
max_position: 2.22
has_velocity_limits: true
max_velocity: 2.0
has_acceleration_limits: true
max_acceleration: 5.0
has_jerk_limits: true
max_jerk: 100.0
has_effort_limits: true
max_effort: 1.0
jt2_joint:
has_position_limits: true
min_position: -0.84
max_position: 1.84
has_velocity_limits: true
max_velocity: 2.0
has_acceleration_limits: true
max_acceleration: 5.0
has_jerk_limits: true
max_jerk: 100.0
has_effort_limits: true
max_effort: 1.0
jt3_joint:
has_position_limits: true
min_position: -2.63
max_position: 2.63
has_velocity_limits: true
max_velocity: 2.0
has_acceleration_limits: true
max_acceleration: 5.0
has_jerk_limits: true
max_jerk: 100.0
has_effort_limits: true
max_effort: 1.0
jt4_joint:
has_position_limits: true
min_position: -0.6
max_position: 0.6
has_velocity_limits: true
max_velocity: 2.0
has_acceleration_limits: true
max_acceleration: 5.0
has_jerk_limits: true
max_jerk: 100.0
has_effort_limits: true
max_effort: 1.0
jt5_joint:
has_position_limits: true
min_position: 0
max_position: 0.03
has_velocity_limits: true
max_velocity: 2.0
has_acceleration_limits: true
max_acceleration: 5.0
has_jerk_limits: true
max_jerk: 100.0
has_effort_limits: true
max_effort: 1.0
/myrobot/config/ros_contollers.yaml
# Publish all joint states
# Creates the /joint_states topic necessary in ROS
joint_state_controller:
type: joint_state_controller/JointStateController
publish_rate: 50
controller_list:
[]
myrobot:
joint_1:
type: position_controllers/JointPositionController
joint: jt1_joint
joint_2:
type: position_controllers/JointPositionController
joint: jt2_joint
joint_3:
type: position_controllers/JointPositionController
joint: jt3_joint
joint_4:
type: position_controllers/JointPositionController
joint: jt4_joint
The problem is, from what i can gather, MoveIt requires a group of joints, not individual joints
Following this tutorial MoveIt setup assistant I created a MoveIt configuration. This tutorial asks to specify the Planning Group, which is created including the 4 joints related to the arm part, the gripper is joint5. A note about 4DOF, I found that if i add "position_only_ik: True" to the kinematics.yaml ...