ROS | STATE |
---|---|
Run the Gazebo simulation
cd piper_ros
source devel/setup.bash
roslaunch piper_gazebo piper_gazebo.launch
Control the gripper arm via RViz GUI (Run in a new terminal)
cd piper_ros
source devel/setup.bash
roslaunch piper_description display_gripper_urdf.launch
Run the Gazebo simulation
cd piper_ros
source devel/setup.bash
roslaunch piper_gazebo piper_no_gripper_gazebo.launch
Control the arm without the gripper via RViz GUI (Run in a new terminal)
cd piper_ros
source devel/setup.bash
roslaunch piper_description display_no_gripper_urdf.launch
The /joint_states
topic controls multiple joints simultaneously, while other topics control individual joints.
Principle: The joint_states_ctrl
node converts /joint_states
control information into control information for each joint, such as /piper_description/joint1_position_controller/command
, to control the arm in Gazebo simulation.
Note: Joint 7 directly controls both joint 7 and joint 8, so joint 8 is not involved in the control of /joint_states
.
/joint_states
/gazebo/joint1_position_controller/command
/gazebo/joint2_position_controller/command
/gazebo/joint3_position_controller/command
/gazebo/joint4_position_controller/command
/gazebo/joint5_position_controller/command
/gazebo/joint6_position_controller/command
/gazebo/joint7_position_controller/command
/gazebo/joint8_position_controller/command
-
Extract the files
mkdir ~/.mujoco cd (Directory containing the package) tar -zxvf mujoco210-linux-x86_64.tar.gz -C ~/.mujoco
-
Add the environment variable
echo "export LD_LIBRARY_PATH=~/.mujoco/mujoco210/bin:\$LD_LIBRARY_PATH" >> ~/.bashrc source ~/.bashrc
-
Test the installation
cd ~/.mujoco/mujoco210/bin ./simulate ../model/humanoid.xml
-
Download the source code
git clone https://github.com/openai/mujoco-py.git
-
Install (This step can be done within a conda environment)
cd ~/mujoco-py pip3 install -U 'mujoco-py<2.2,>=2.1' pip3 install -r requirements.txt pip3 install -r requirements.dev.txt python3 setup.py install sudo apt install libosmesa6-dev sudo apt install patchelf
-
Add the environment variable
echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/nvidia" >> ~/.bashrc source ~/.bashrc
-
Test the installation
import mujoco_py import os mj_path = mujoco_py.utils.discover_mujoco() xml_path = os.path.join(mj_path, 'model', 'humanoid.xml') model = mujoco_py.load_model_from_path(xml_path) sim = mujoco_py.MjSim(model) print(sim.data.qpos) sim.step() print(sim.data.qpos)
Run the Mujoco simulation
cd piper_ros
source devel/setup.bash
roslaunch piper_mujoco piper_mujoco.launch
Control the gripper arm via RViz GUI (Run in a new terminal)
cd piper_ros
source devel/setup.bash
roslaunch piper_description display_gripper_urdf.launch
Run the Mujoco simulation
cd piper_ros
source devel/setup.bash
roslaunch piper_mujoco piper_no_gripper_mujoco.launch
Control the arm without the gripper via RViz GUI (Run in a new terminal)
cd piper_ros
source devel/setup.bash
roslaunch piper_description display_no_gripper_urdf.launch
Control parameters for the gripper
Control parameters for without gripper
-
damping="100" Adjust joint damping
-
kp="10000" Adjust joint control gain
-
forcerange="-100 100" Adjust joint torque control (Set
forcelimited="false"
totrue
, then addforcerange="-100 100"
)