In both cases, you will need a FollowJointTrajectoryAction already implemented on your robot - this is the way that move_group connects to the controllers on your robot (see the first figure on this page for a description of the MoveIt! architecture: http://moveit.ros.org/documentation/concepts/#System_Architecture). Using ros_control and Gazebo, you can get this action easily by configuring it in YAML. On your own hardware though, you will have to implement this yourself (or use ros_control). This implementation is currently non-trivial and I would encourage you to look at the ROS control documentation for more information.It walks through the configuration process for configuring MoveIt! for your robot - this will work with Gazebo and with your own robot as well.Hi Mike,Follow the new tutorial on integrating controllers here: http://docs.ros.org/api/pr2_moveit_tutorials/html/planning/src/doc/controller_configuration.html
Hope this helps,
Best Regards,
SachinOn Thu, Feb 20, 2014 at 6:54 AM, <mfr...@vt.edu> wrote:
Hey everyone,I have created my own custom arm manipulator and want to send a motion plan that moveit created to the actual arm controller. I read through http://moveit.ros.org/wiki/Executing_Trajectories_with_MoveIt! and understand how a RobotTrajectory msg gets created once a motion plan is created by moveit. I also understand that I need to use the moveit_simple_controller_manager plugin to account for the arm controller from the movegroup node side. However I do not understand how the RobotTrajectory msg gets sent to the moveit_simple_controller_manager. Then, I understand that I need to define the arm controller in the movegroup config package using the .yaml extension, as well as update the move_group.launch to use the moveit_controller_manager. Next, I understand that within the moveit_simple_controller_manager that I have to use the follow_joint_trajectory action in order to send the RobotTrajectory msg from the movegroup node to the arm controller. However I have a couple problems with understanding the steps that need to be taken for that process to happen. For one thing do I need to create an arm controller ros node that handles the RobotTrajectory msg? If so what packages do I need to use in order for the arm controller ros node to interface with the actual arm that takes serial type commands? Would I need to use ros_control & and ros_controllers as dependencies?Also in stead of sending the trajectory to the actual arm controller, I was hoping to find a way of sending the trajectory to Gazebo. I used http://gazebosim.org/wiki/Tutorials/1.9/ROS_Control_with_Gazebo to try to understand how that would work, but I wasnt sure how the movegroup node would interface with the ros_control node and allow for gazebo to get the trajectory at the end.I assume many of these questions could be confusing, and its because I am still new arm manipulation and how to create an infrastructure that uses the ROS meta OS. If any of the assumptions I made above are not true please feel free to correct me as well.Thanks ,Mike
Hey Sachin & Adolfo,Thanks for responding to my message. First Sachin, I followed the tutorial that was posted on http://docs.ros.org/api/pr2_moveit_tutorials/html/planning/src/doc/controller_configuration.html, I made sure to set the "fake execution" argument to false. I assumed this would make the move_group node access the controllers.yaml file instead of the fake_controller.yaml file. I made sure to check both the trajectory & moveit_controller_manager launch files to make sure that they were also looking at the correct controller config file, and controller manager. However when I ran the move_group.launch file I got this error "Unknown substitution command [my robot moveit config pack name] Valid commands are ['find', 'env', 'optenv', 'anon', 'arg']".
This issue only occurred when I set the fake_execution argument to false in the move_group.launch file. If I had set it to true, the move_group.launch file would run successfully. However I did not have access to the controllers.yaml file instead fake_controllers.yaml was used and I verified that using the rostopic list command. My question is why is it when trying to use the actual controllers versus the fake controllers causing my move_group.launch file to not run?Next, I am still having trouble understanding how to use the joint_trajectory_controller package. From what I can understand (After reading the pr2_controller tutorials) I can create a controller package that would have dependencies of joint_trajectory_controller and create a jointtrajectory action server from with a node of that package which would receive the robottrajectory msg from the moveit_controller_manager. Then the node will communicate with the actual robot, is this correct?
Finally, I tired creating a package that used the dependencies ros_control and ros_controller packages by following the tutorial on http://gazebosim.org/wiki/Tutorials/1.9/ROS_Control_with_Gazebo but I kept getting an error sayingCMake Error at /opt/ros/hydro/share/catkin/cmake/catkinConfig.cmake:72 (find_package):Could not find a configuration file for package ros_control.Set ros_control_DIR to the directory containing a CMake configurationfile for ros_control. The file will have one of the following names:ros_controlConfig.cmakeros_control-config.cmakeCMake Error at /opt/ros/hydro/share/catkin/cmake/catkinConfig.cmake:72 (find_package):Could not find a configuration file for package ros_controllers.Set ros_controllers_DIR to the directory containing a CMake configurationfile for ros_controllers. The file will have one of the following names:ros_controllersConfig.cmakeros_controllers-config.cmakeWhen I remove the packages from the Cmakelist.txt "find_package" line the created package gets complied. However when I run the launch file from the package I get this message:[INFO] [WallTime: 1393262845.109880] [0.000000] Controller Spawner: Waiting for service controller_manager/load_controller[WARN] [WallTime: 1393262875.363566] [41.470000] Controller Spawner couldn't find the expected controller_manager ROS interface.
Is this a problem with ros_control, because I defined the yaml file like the tutorial asked me to.
Hey Adolfo,Thanks for responding! You where correct about one of my launch files having a syntax error which was causing my movegroup node to not access my controllers.yaml file. After fixing that problem , I was able to get the movegroup node running however i got this error:[ INFO] [1393361974.553823271]: Constructing new MoveGroup connection for group 'arm'[ INFO] [1393361975.685338329]: MoveitSimpleControllerManager: Waiting for arm_controller/follow_joint_trajectory to come up[ERROR] [1393361980.685604294]: MoveitSimpleControllerManager: Action client not connected: arm_controller/follow_joint_trajectory[ INFO] [1393361980.696513480]: Returned 0 controllers in list[ INFO] [1393361980.707610274]: Trajectory execution is managing controllersThe movegroup node still got created , but I do not think the moveit simple controller manager was able to use arm_Controller I defined in my controllers.yaml. Also when you say to "- Have a running controller manager tied to your robot hardware abstraction, like the one offered by gazebo_ros_control." Are you saying that I need to have two control managers one on the moviet side(action client) and another on the robot hardware abstraction side (action server)?
This is line I used to create joint_trajectory_controller ros node in order for the controller manager to get created for gazebo_ros_control<node name="joint_trajectory_controller" pkg="controller_manager" type="spawner" respawn="false"output="screen" ns="arm_controller/follow_joint_trajectory" args="joint1_position_controller joint2_position_controller joint3_position_controller joint4_position_controller joint_state_controller"/>
Is this correct?Finally I made sure that ros_control and ros_controllers are installed via source by using roscd and finding it.Thanks again for all the help, I am just trying to connect the dots and its been tough so I apologize if these questions dont make sense or are dumb.
Hey Adolfo,
Thanks for the feed back as always! I wanted to say that I am running a instance of the gazebo_ros_control to create an instance of a control manager , by creating it in my urdf file with my arm's model. :<robot>...(end of the model description)<gazebo><plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so"></plugin></gazebo></robot>In my urdf I also make sure to define the transmission tags for each joint like gazebo ros conrtol tutorials asks for.When running the the demo.launch file that gets created through the moveit_config package it creates an instance of a move_group node (amongst other things) and it uses the urdf file that I described above, therefore an instance of a gazebo_ros_control controller manager should be up (can I see this using rostopic list, or under ROS parameters?).
Hey,I have posted my concerns on the ros_control google group forum (https://groups.google.com/forum/?fromgroups#!topic/ros-sig-robot-control/gMU383xm-v8). But basically I do not think that the plugin is working. How do I verify that the plugin is not working without using rosservice? Also I do not need to define my own action server in order to send over the motion plan from moveit to gazebo correct? Thats what the plugin is suppose to do? Finally, I cannot find the definition of the gazebo_ros_control controller.yaml, I cannot see what parameters of this file mean.