Going further with the Webots / ROS interface It is possible to monitor the output of the joy node while the simulation is running by issuing the following ROS command: This message is received by the joystick controller that interprets it to drive the simulated robot (i.e., 'up' -> move forward, 'left' -> turn left, etc.). When you move the joystick, the joy node receives an event from the joystick and emits a corresponding message. This will in turn start the joystick controller that will launch the joy ROS node (using 'roslaunch') and subscribe to its "joy" topic. Simply open the worlds/joystick.wbt file and run the simulation. Alternatively, you can also press the "build" button in the Webots IDE. In order to compile this controller, simply go to the joystick This will in turn call rosmake with all the necessary things to get the joystick controller compiled and linked against ROS and Webots libraries. In order to be able to compile and use this webots_joystick node, you should add the full path of your Webots project (i.e., /home/joe/webots/my_ros_project/) to the ROS_PACKAGE_PATH in '/opt/ros/cturtle/setup.sh'.įinally, you may need to adjust the device name in the joy.launch file (e.g., "/dev/input/js1"). * copy all the other files of the 'webots_joystick' directory into this new 'joystick' directory. * create a new directory named 'joystick' in the 'controllers' directory of your project and * copy the 'joystick.wbt' file from the 'webots_joystick' directory into the 'worlds' directory of your Webots project, A Webots project is simply a directory containing a number of sub-directories including 'controllers' and 'worlds'. In order to proceed, you can use the Webots wizard to create a new Webots project. The Webots Joystick package should be installed in a new Webots project. To run this specific example, you will also need a standard joystick or gamepad connected to your Linux box. The setup details (repository URL and authentication key file) are provided here. However, in order for ROS to be able to install it automatically, you will need to setup the correct Webots deb repository in your apt system. Webots was declared as a rosdep dependency in the webots packages and is referred to in the rosdep.yaml file of the Webots stack. It will nevertheless allow you to run the Webots Joystick ROS code. Such a version is actually equivalent to the full version of Webots PRO, but is limited to 30 days. Webots is a commercial software and if you don't already have a copy of it, you can get a free 30 day trial version from Cyberbotics. You will obviously need to install Webots in order to be able to use this package. It is a good starting point to implement a C++ interface between Webots and ROS for controlling simulated robots in Webots from ROS. This input is used to drive a simulated robot in Webots. This controller launches the ROS joy node and subscribes to its 'joy' topic to read the input from a joystick. It contains a sample ROS node that is actually a Webots robot controller. It is a simple example of interfacing Webots and ROS using a C++ Webots controller and roscpp. The webots_joystick package is part of the webots stack. Going further with the Webots / ROS interface.Overview of the Webots Joystick package.
0 Comments
Leave a Reply. |