安装arbotix simulator仿真环境--9

时间:2022-01-05 05:24:19

原创博客:转载请表明出处: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-.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:
* /arbotix/controllers/base_controller/Kd:
* /arbotix/controllers/base_controller/Ki:
* /arbotix/controllers/base_controller/Ko:
* /arbotix/controllers/base_controller/Kp:
* /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:
* /arbotix/controllers/base_controller/type: diff_controller
* /arbotix/port: /dev/ttyUSB0
* /arbotix/rate:
* /arbotix/read_rate:
* /arbotix/sim: True
* /arbotix/sync_read: True
* /arbotix/sync_write: True
* /arbotix/write_rate:
* /robot_description: <?xml version="1....
* /robot_state_publisher/publish_frequency: 20.0
* /rosdistro: indigo
* /rosversion: 1.11.
* /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-]: started with pid []
process[robot_state_publisher-]: started with pid []

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

roslaunch rbx1_bringup fake_pi_robot.launch

输出信息如下:

PARAMETERS
* /arbotix/baud:
* /arbotix/controllers/base_controller/Kd:
* /arbotix/controllers/base_controller/Ki:
* /arbotix/controllers/base_controller/Ko:
* /arbotix/controllers/base_controller/Kp:
* /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:
* /arbotix/controllers/base_controller/type: diff_controller
* /arbotix/joints/arm_elbow_flex_joint/id:
* /arbotix/joints/arm_elbow_flex_joint/invert: True
* /arbotix/joints/arm_elbow_flex_joint/max_speed:
* /arbotix/joints/arm_elbow_flex_joint/neutral:
* /arbotix/joints/arm_shoulder_lift_joint/id:
* /arbotix/joints/arm_shoulder_lift_joint/invert: True
* /arbotix/joints/arm_shoulder_lift_joint/max_speed:
* /arbotix/joints/arm_shoulder_lift_joint/neutral:
* /arbotix/joints/arm_shoulder_pan_joint/id:
* /arbotix/joints/arm_shoulder_pan_joint/invert: False
* /arbotix/joints/arm_shoulder_pan_joint/max_angle:
* /arbotix/joints/arm_shoulder_pan_joint/max_speed:
* /arbotix/joints/arm_shoulder_pan_joint/min_angle: -
* /arbotix/joints/arm_shoulder_pan_joint/neutral:
* /arbotix/joints/arm_wrist_flex_joint/id:
* /arbotix/joints/arm_wrist_flex_joint/invert: True
* /arbotix/joints/arm_wrist_flex_joint/max_angle:
* /arbotix/joints/arm_wrist_flex_joint/max_speed:
* /arbotix/joints/arm_wrist_flex_joint/min_angle: -
* /arbotix/joints/arm_wrist_flex_joint/neutral:
* /arbotix/joints/gripper_joint/id:
* /arbotix/joints/gripper_joint/invert: False
* /arbotix/joints/gripper_joint/max_angle:
* /arbotix/joints/gripper_joint/max_speed:
* /arbotix/joints/gripper_joint/min_angle: -
* /arbotix/joints/gripper_joint/neutral:
* /arbotix/joints/head_pan_joint/id:
* /arbotix/joints/head_pan_joint/invert: False
* /arbotix/joints/head_pan_joint/max_angle:
* /arbotix/joints/head_pan_joint/max_speed:
* /arbotix/joints/head_pan_joint/min_angle: -
* /arbotix/joints/head_pan_joint/neutral:
* /arbotix/joints/head_tilt_joint/id:
* /arbotix/joints/head_tilt_joint/invert: False
* /arbotix/joints/head_tilt_joint/max_angle:
* /arbotix/joints/head_tilt_joint/max_speed:
* /arbotix/joints/head_tilt_joint/min_angle: -
* /arbotix/joints/head_tilt_joint/neutral:
* /arbotix/port: /dev/ttyUSB0
* /arbotix/rate:
* /arbotix/read_rate:
* /arbotix/sim: True
* /arbotix/sync_read: True
* /arbotix/sync_write: True
* /arbotix/write_rate:
* /robot_description: <?xml version="1....
* /robot_state_publisher/publish_frequency: 20.0
* /rosdistro: indigo
* /rosversion: 1.11.
* /use_sim_time: False

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

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

安装arbotix simulator仿真环境--9

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

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

安装arbotix simulator仿真环境--9

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

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