Python 在露台上行走机器人
我想在gazebo中模拟下肢外骨骼(LLE)。我正试图让它在露台上移动一步。但它没有迈出一步。有趣的是,我看不到终端中有任何错误。我使用XML(xacro格式)描述机器人,启动控制文件,使用gazebo和python进行行走。 这是我的密码: 1.xacro文件:(lle_sample4.xacro) 四,。lle_示例_control2.launch:Python 在露台上行走机器人,python,ros,Python,Ros,我想在gazebo中模拟下肢外骨骼(LLE)。我正试图让它在露台上移动一步。但它没有迈出一步。有趣的是,我看不到终端中有任何错误。我使用XML(xacro格式)描述机器人,启动控制文件,使用gazebo和python进行行走。 这是我的密码: 1.xacro文件:(lle_sample4.xacro) 四,。lle_示例_control2.launch: <launch> <!-- Load joint controller configurations from YAML
<launch>
<!-- Load joint controller configurations from YAML file to parameter server -->
<rosparam file="$(find lle_sample_control)/config/lle_sample_control2.yaml"/>
<!-- load the controllers -->
<node name="lle_sample_control2" pkg="controller_manager" type="spawner" respawn="false"
output="screen" ns="/lle_sample" args="--namespace=/lle_sample joint_state_controller joint_right_hip_position_controller joint_left_hip_position_controller joint_right_knee_position_controller joint_left_knee_position_controller --timeout 100"/>
<!-- 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">=
<remap from="/joint_states" to="/lle_sample/joint_states" />
</node>
</launch>
在一个终端中,我使用$roslaunch lle\u sample\u gazebo lle\u sample\u gazebo.launch
在另一个终端,我写$rosrun lle_sample_gazebo walker.py
当我点击播放按钮时,我看到“lle_示例步行器演示开始”,但露台中的模型是实心的
<robot>
<!-- ros_control plugin -->
<gazebo>
<plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
<robotNamespace>lle_sample</robotNamespace>
<robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType>
</plugin>
</gazebo>
<!-- Base Link -->
<gazebo reference="base_link">
<kp>6000000.0</kp>
<kd>10000000.0</kd>
<material>Gazebo/Red</material>
</gazebo>
<!-- Right Femur-->
<gazebo reference="right_femur">
<kp>6000000.0</kp>
<kd>10000000.0</kd>
<mu1>0.2</mu1>
<mu2>0.2</mu2>
<material>Gazebo/Green</material>
</gazebo>
<!-- Right Leg-->
<gazebo reference="right_leg">
<kp>6000000.0</kp>
<kd>10000000.0</kd>
<mu1>0.2</mu1>
<mu2>0.2</mu2>
<material>Gazebo/Blue</material>
</gazebo>
<!-- Right Foot -->
<gazebo reference="right_foot">
<material>Gazebo/Yellow</material>
</gazebo>
<!-- Left Femur-->
<gazebo reference="left_femur">
<kp>6000000.0</kp>
<kd>10000000.0</kd>
<mu1>0.2</mu1>
<mu2>0.2</mu2>
<material>Gazebo/Green</material>
</gazebo>
<!-- Left Leg-->
<gazebo reference="left_leg">
<kp>6000000.0</kp>
<kd>10000000.0</kd>
<mu1>0.2</mu1>
<mu2>0.2</mu2>
<material>Gazebo/Blue</material>
</gazebo>
<!-- Left foot-->
<gazebo reference="left_foot">
<material>Gazebo/Yellow</material>
</gazebo>
</robot>
lle_sample:
# Publish all joint states -----------------------------------
joint_state_controller:
type: joint_state_controller/JointStateController
publish_rate: 50
# Position Controllers ---------------------------------------
joint_right_hip_position_controller:
type: effort_controllers/JointPositionController
joint: joint_right_hip
pid: {p: 100.0, i: 0.01, d: 10.0}
joint_right_knee_position_controller:
type: effort_controllers/JointPositionController
joint: joint_right_knee
pid: {p: 100.0, i: 0.01, d: 10.0}
joint_left_hip_position_controller:
type: effort_controllers/JointPositionController
joint: joint_left_hip
pid: {p: 100.0, i: 0.01, d: 10.0}
joint_left_knee_position_controller:
type: effort_controllers/JointPositionController
joint: joint_left_knee
pid: {p: 100.0, i: 0.01, d: 10.0}
<launch>
<!-- Load joint controller configurations from YAML file to parameter server -->
<rosparam file="$(find lle_sample_control)/config/lle_sample_control2.yaml"/>
<!-- load the controllers -->
<node name="lle_sample_control2" pkg="controller_manager" type="spawner" respawn="false"
output="screen" ns="/lle_sample" args="--namespace=/lle_sample joint_state_controller joint_right_hip_position_controller joint_left_hip_position_controller joint_right_knee_position_controller joint_left_knee_position_controller --timeout 100"/>
<!-- 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">=
<remap from="/joint_states" to="/lle_sample/joint_states" />
</node>
</launch>
<launch>
<!-- We resume the logic in gazebo_ros package empty_world.launch, -->
<!-- changing only the name of the world to be launched -->
<include file="$(find lle_sample_control)/launch/lle_sample_control2.launch" />
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" value="worlds/empty.world"/>
<arg name="paused" value="true"/>
</include>
<!-- Load the URDF into the ROS Parameter Server -->
<param name="robot_description"
command="$(find xacro)/xacro.py '$(find lle_sample_description)/urdf/lle_sample4.xacro'" />
<!-- Spawn lle_sample into Gazebo -->
<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" respawn="false" output="screen"
args="-param robot_description -urdf -model lle_sample" />
<node name="lle_sample_walker" pkg="lle_sample_gazebo" type="walker.py" />
</launch>
#!/usr/bin/env python
import rospy
from lle_sample_gazebo.lle_sample import LLE_sample
if __name__=="__main__":
rospy.init_node("walker_demo")
rospy.loginfo("Instantiating lle_sample Client")
lle_sample=LLE_sample()
rospy.sleep(1)
rospy.loginfo("lle_sample Walker Demo Starting")
lle_sample.set_walk_velocity(0.2,0,0)
rospy.sleep(3)
lle_sample.set_walk_velocity(1,0,0)
rospy.sleep(3)
lle_sample.set_walk_velocity(0,1,0)
rospy.sleep(3)
lle_sample.set_walk_velocity(0,-1,0)
rospy.sleep(3)
lle_sample.set_walk_velocity(-1,0,0)
rospy.sleep(3)
lle_sample.set_walk_velocity(0,0,0)
rospy.loginfo("lle_sample Walker Demo Finished")