The second solution named custom ROS controller requires that you build your own Webots controller that will also be a ROS node using Webots and ROS libraries. The webots_controllers_to_load parameter contains the controller names from the yaml file. This controller can be used on any robot in Webots and acts as a ROS node, providing all the Webots functions as services or topics to other ROS nodes. This contains the name of the ROS topic for joint commands, the servo names from the Webots model, and the P constant for the position controller.Ĭreate a launch file in the /launch directory, using this package as an example. yaml file in the /config directory, using this package as an example. Edit your Webots world file and specify the name of the controller binary fileĬreate a new.Note how the destination of the compiled binary is in the controllers/binary_name directory to suit Webots requirements, not the default ROS directory /bin wbt world file to your package, in the /world directoryĬopy the webots_controllers source to the /src directoryĮdit CMakeLists.txt, using this package as an example. See Creating a ROS PackageĪdd the Webots. Assign each joint servo with a unique name.Ĭeate a new ROS package e.g. Create a new Webots world and robot arm model. This command publishes one message to the ROS topic and the " -" indiciates that the next input is a number. The joint will rotate 1.5 radians in the positive direction. To move that joint, run the command: $ rostopic pub -1 /Puma560/SimController/waist/command std_msgs/Float64 - 1.5 To move one of the joints, you need to publish the desired position to theįor example, the base rotation joint is called 'waist'. List the available joint controllers by opening a new shell console and running: $ rostopic list If everything is working correctly, the following messages will be printed in the Webots console: The Webots simulator should load with the Puma 560 in the home position. Webots Version: R2021a ROS Version: Foxy Operating System: Windows 10 (Both Webots and ROS2 are installed in Windows 10) Graphics Card: AMD Radon M360 (pretty old one but it works) The text was updated successfully, but these errors were encountered: All reactions. Run the demo: $ roslaunch webots_controllers joint_position_controller_demo.launch Position commands are received on a ROS topic for each joint.Ĭurrent position and calculated velocity values are published on the /joint_states topic.įorce information is not checked due to a bug with Webots 6.4.4įollow these instructions to install the kaist_webots stack.Ī demo of the joint position controller is included, using ROS messages to control a simulated Puma 560 manipulator in Webots. The webots_controllers_to_load parameter in the launch file specifies which controllers from the yaml file should be loaded. The controller configuration is defined in a yaml file, which includes the ROS topic for subscribing to commands for each joint, the joint's servo name in Webots, and the value of the P constant. A joint position controller for Webots, utilising the C++ API and simple P-control.
0 Comments
Leave a Reply. |