gazebo 模型不动
添加了控制器之后,发布命令,gazebo中的模型没动静
后来才发现是从solidwork导出urdf的时候velocity
和effort
设置成0
了
改过来就好了
<limit lower="-3.14" upper="3.14" effort="100" velocity="1.0" />
附上launch
文件
<launch>
<!-- these are the arguments you can pass this launch file, for example paused:=true -->
<arg name="paused" default="false"/>
<arg name="use_sim_time" default="true"/>
<arg name="gui" default="true"/>
<arg name="headless" default="false"/>
<arg name="debug" default="false"/>
<!-- We resume the logic in empty_world.launch -->
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="debug" value="$(arg debug)" />
<arg name="gui" value="$(arg gui)" />
<arg name="paused" value="$(arg paused)"/>
<arg name="use_sim_time" value="$(arg use_sim_time)"/>
<arg name="headless" value="$(arg headless)"/>
</include>
<!-- Load the URDF into the ROS Parameter Server -->
<!-- <param name="robot_description" command="$(find xacro)/xacro '$(find gluon)/urdf/robot_arm.xacro'" /> -->
<param name="robot_description" textfile="$(find gluon)/urdf/robot_arm.urdf" />
<!-- Run a python script to the send a service call to gazebo_ros to spawn a URDF robot -->
<node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model" respawn="false" output="screen"
args="-urdf -model robot_arm -param robot_description"/>
<!-- Load joint controller configurations from YAML file to parameter server -->
<rosparam file="$(find gluon_control)/config/trajectory.yaml" command="load"/>
<!-- load the controllers -->
<node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false"
output="screen" args="joint_state_controller robot_joint_controller"/>
<!-- convert joint states to TF transforms for rviz, etc -->
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"
respawn="false" output="screen" />
</launch>
和yaml
文件
joint_state_controller:
type: joint_state_controller/JointStateController
publish_rate: 50
robot_joint_controller:
type: "position_controllers/JointTrajectoryController"
joints:
- j_1
- j_2
- j_3
- j_4
- j_5
gains:
joint1: {p: 1000.0, i: 0.0, d: 0.1, i_clamp: 0.0}
joint2: {p: 1000.0, i: 0.0, d: 0.1, i_clamp: 0.0}
joint3: {p: 1000.0, i: 0.0, d: 0.1, i_clamp: 0.0}
joint4: {p: 1000.0, i: 0.0, d: 0.1, i_clamp: 0.0}
joint5: {p: 1000.0, i: 0.0, d: 0.1, i_clamp: 0.0}