【V-REP Learning Record 05】Simulating the robotic arm using V-REP and ROS

【V-REP Learning Record 01】Setting up V-REP with ROS

【V-REP Learning Record 02】Understanding the vrep_plugin

【V-REP Learning Record 03】Interacting with V-REP using ROS services

【V-REP Learning Record 04】Interacting with V-REP using ROS topics

This section mainly describes the use of V-REP to import and simulate a seven-degree-of-freedom robotic arm.

Step one: Import our seven-degree-of-freedom robotic arm into the simulation scene. V-REP allows you to import new robots using URDF files. Therefore, we have to convert the xacro model of the arm into a URDF file and save the generated URDF file in the URDF folder of the vrep_demo_pkg package:

rosrun xacro xacro seven_dof_arm.xacro -inorder > /path/to/vrep_demo_pkg/urdf/seven_dof_arm.urdf

 

        Even though the robot has been imported correctly, it is not yet ready to be controlled. In order to drive the robot we need to enable all robot motors from the joint dynamic properties panel. Unless the motor is disabled, it is not possible to move it during the simulation. To enable a joint's motors, open the Scene Object Properties panel and select its entry from the main drop-down menu: Tools | Scene Object Properties. You can also open this dialog box by double-clicking the object icon in the scene hierarchy. In this new window, open the Dynamic Properties dialog box, enable the control loops for the motors and joints, and select the controller type. By default, the motor is controlled by PID, as shown in the figure below:        

        In order to improve the performance of the control loop, the PID gain should be adjusted appropriately. After enabling the motors and control loops for all robot joints, we can check that everything is configured correctly. Run the simulation and set the target position from the scene object properties panel.

         Here's an example of moving the fourth joint to 1.0 radians:

 

Guess you like

Origin blog.csdn.net/cz_include/article/details/131394947