How to modify gazebo physical parameters
This article introduces the relevant knowledge of "how to modify gazebo physical parameters". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
%% modified to virtual machine IP address ipaddress = '192.168.137.128 desktop% initialize rosinit (ipaddress)%% get all rostopic list%% get gazebo elements gazebo = ExampleHelperGazeboCommunicator ();% get gazebo physical parameters phys = readPhysics (gazebo)%% modify gravity to upward phys.Gravity = [000.1];% SI unit setPhysics (gazebo,phys); resetSim (gazebo); pause (5);% new gravity takes effect for 5s
% pause 3 seconds pauseSim (gazebo); pause (3);% resume 3 seconds and continue to rise resumeSim (gazebo); pause (3);% modify simulation speed to original 1/8pauseSim (gazebo) after pausing; phys = readPhysics (gazebo); phys.UpdateRate = phys.UpdateRate/8;setPhysics (gazebo,phys);% phys.Gravity = [0-9.8]; change back to normal gravity parameters
SetPhysics (gazebo,phys); resumeSim (gazebo); pause (5);% phys.UpdateRate = phys.UpdateRate*8;% Simulation Speed returns to normal setPhysics (gazebo,phys); pause (3);% reset gazeboresetSim (gazebo);% empty clear%% close connection rosshutdown "how to modify gazebo physical parameters" is introduced here, thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!