安装arbotix simulator仿真环境--9

原创博客:转载请表明出处:http://www.cnblogs.com/zxouxuewei/  周学伟

安装之前:首先确保已经正常制作了ros工作空间并且安装了rbx1功能包:

cd ~/catkin_ws/src
git clone https://github.com/pirobot/rbx1.git
cd rbx1
git checkout indigo-devel
cd ~/catkin_ws
catkin_make
source ~/catkin_ws/devel/setup.bash
rospack profile 

1.安装simulator

sudo apt-get install ros-indigo-arbotix-*

注意:一定要删除任何早期版本的arbotix依赖。

rospack profile

2. 为了确保一切工作,确保roscore运行,然后启动模拟turtlebot如下

roslaunch rbx1_bringup fake_turtlebot.launch
输出信息如下:
.. logging to /root/.ros/log/c0433730-e414-11e5-8d90-c48e8f5baa47/roslaunch-zxwubuntu-Aspire-V3-572G-3649.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://zxwubuntu-Aspire-V3-572G:56323/

SUMMARY
========

CLEAR PARAMETERS
 * /arbotix/

PARAMETERS
 * /arbotix/baud: 115200
 * /arbotix/controllers/base_controller/Kd: 12
 * /arbotix/controllers/base_controller/Ki: 0
 * /arbotix/controllers/base_controller/Ko: 50
 * /arbotix/controllers/base_controller/Kp: 12
 * /arbotix/controllers/base_controller/accel_limit: 1.0
 * /arbotix/controllers/base_controller/base_frame_id: base_footprint
 * /arbotix/controllers/base_controller/base_width: 0.26
 * /arbotix/controllers/base_controller/ticks_meter: 4100
 * /arbotix/controllers/base_controller/type: diff_controller
 * /arbotix/port: /dev/ttyUSB0
 * /arbotix/rate: 20
 * /arbotix/read_rate: 20
 * /arbotix/sim: True
 * /arbotix/sync_read: True
 * /arbotix/sync_write: True
 * /arbotix/write_rate: 20
 * /robot_description: <?xml version="1....
 * /robot_state_publisher/publish_frequency: 20.0
 * /rosdistro: indigo
 * /rosversion: 1.11.16
 * /use_sim_time: False

NODES
  /
    arbotix (arbotix_python/arbotix_driver)
    robot_state_publisher (robot_state_publisher/state_publisher)

ROS_MASTER_URI=http://localhost:11311

core service [/rosout] found
process[arbotix-1]: started with pid [3671]
process[robot_state_publisher-2]: started with pid [3672]

3.使用一个模型的pi-机器人,运行命令:

roslaunch rbx1_bringup fake_pi_robot.launch

输出信息如下:

PARAMETERS
 * /arbotix/baud: 115200
 * /arbotix/controllers/base_controller/Kd: 12
 * /arbotix/controllers/base_controller/Ki: 0
 * /arbotix/controllers/base_controller/Ko: 50
 * /arbotix/controllers/base_controller/Kp: 12
 * /arbotix/controllers/base_controller/accel_limit: 1.0
 * /arbotix/controllers/base_controller/base_frame_id: base_link
 * /arbotix/controllers/base_controller/base_width: 0.26
 * /arbotix/controllers/base_controller/ticks_meter: 4100
 * /arbotix/controllers/base_controller/type: diff_controller
 * /arbotix/joints/arm_elbow_flex_joint/id: 3
 * /arbotix/joints/arm_elbow_flex_joint/invert: True
 * /arbotix/joints/arm_elbow_flex_joint/max_speed: 100
 * /arbotix/joints/arm_elbow_flex_joint/neutral: 512
 * /arbotix/joints/arm_shoulder_lift_joint/id: 2
 * /arbotix/joints/arm_shoulder_lift_joint/invert: True
 * /arbotix/joints/arm_shoulder_lift_joint/max_speed: 100
 * /arbotix/joints/arm_shoulder_lift_joint/neutral: 512
 * /arbotix/joints/arm_shoulder_pan_joint/id: 1
 * /arbotix/joints/arm_shoulder_pan_joint/invert: False
 * /arbotix/joints/arm_shoulder_pan_joint/max_angle: 145
 * /arbotix/joints/arm_shoulder_pan_joint/max_speed: 100
 * /arbotix/joints/arm_shoulder_pan_joint/min_angle: -145
 * /arbotix/joints/arm_shoulder_pan_joint/neutral: 512
 * /arbotix/joints/arm_wrist_flex_joint/id: 4
 * /arbotix/joints/arm_wrist_flex_joint/invert: True
 * /arbotix/joints/arm_wrist_flex_joint/max_angle: 90
 * /arbotix/joints/arm_wrist_flex_joint/max_speed: 100
 * /arbotix/joints/arm_wrist_flex_joint/min_angle: -90
 * /arbotix/joints/arm_wrist_flex_joint/neutral: 512
 * /arbotix/joints/gripper_joint/id: 5
 * /arbotix/joints/gripper_joint/invert: False
 * /arbotix/joints/gripper_joint/max_angle: 25
 * /arbotix/joints/gripper_joint/max_speed: 100
 * /arbotix/joints/gripper_joint/min_angle: -20
 * /arbotix/joints/gripper_joint/neutral: 512
 * /arbotix/joints/head_pan_joint/id: 6
 * /arbotix/joints/head_pan_joint/invert: False
 * /arbotix/joints/head_pan_joint/max_angle: 145
 * /arbotix/joints/head_pan_joint/max_speed: 100
 * /arbotix/joints/head_pan_joint/min_angle: -145
 * /arbotix/joints/head_pan_joint/neutral: 512
 * /arbotix/joints/head_tilt_joint/id: 7
 * /arbotix/joints/head_tilt_joint/invert: False
 * /arbotix/joints/head_tilt_joint/max_angle: 90
 * /arbotix/joints/head_tilt_joint/max_speed: 100
 * /arbotix/joints/head_tilt_joint/min_angle: -90
 * /arbotix/joints/head_tilt_joint/neutral: 512
 * /arbotix/port: /dev/ttyUSB0
 * /arbotix/rate: 20
 * /arbotix/read_rate: 20
 * /arbotix/sim: True
 * /arbotix/sync_read: True
 * /arbotix/sync_write: True
 * /arbotix/write_rate: 20
 * /robot_description: <?xml version="1....
 * /robot_state_publisher/publish_frequency: 20.0
 * /rosdistro: indigo
 * /rosversion: 1.11.16
 * /use_sim_time: False 

4.接下来,把rviz所以我们可以观察模拟机器人在行动:

rosrun rviz rviz -d `rospack find rbx1_nav`/sim.rviz

安装arbotix simulator仿真环境--9_第1张图片

5.发布消息,使机器人移动。要测试模拟,打开另一个终端窗口,并运行以下要使模拟机器人在逆时针方向移动:

rostopic pub -r 10 /cmd_vel geometry_msgs/Twist '{linear: {x: 0.2, y: 0, z: 0}, angular: {x: 0, y: 0, z: 0.5}}'

安装arbotix simulator仿真环境--9_第2张图片

6.需要停止机器人 ,在同一个终端窗口式Ctrl-C,或者发布空Twist message:

rostopic pub -1 /cmd_vel geometry_msgs/Twist '{}'

 

你可能感兴趣的:(安装arbotix simulator仿真环境--9)