Turtlebot3多机建图时出现的tf问题

Turtlebot3多机建图时 odom的tf发布出现问题 本应是/tb3_0/odom但发布出来的仍然时/odom
 
 
multi_robot_error_frames.png
ubuntu@burger:~$ ROS_NAMESPACE=tb3_0 roslaunch turtlebot3_bringup turtlebot3_robot.launch multi_robot_name:="tb3_0" set_lidar_frame_id:="tb3_0/base_scan"
... logging to /home/ubuntu/.ros/log/bfe964d6-1722-11ea-8909-000c2965f318/roslaunch-burger-1547.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://192.168.0.25:42893/

SUMMARY
========

PARAMETERS
* /rosdistro: kinetic
* /rosversion: 1.12.14
* /tb3_0/turtlebot3_core/baud: 115200
* /tb3_0/turtlebot3_core/port: /dev/ttyACM0
* /tb3_0/turtlebot3_core/tf_prefix: tb3_0
* /tb3_0/turtlebot3_lds/frame_id: tb3_0/base_scan
* /tb3_0/turtlebot3_lds/port: /dev/ttyUSB0

NODES
/tb3_0/
turtlebot3_core (rosserial_python/serial_node.py)
turtlebot3_diagnostics (turtlebot3_bringup/turtlebot3_diagnostics)
turtlebot3_lds (hls_lfcd_lds_driver/hlds_laser_publisher)

ROS_MASTER_URI=http://192.168.0.184:11311

process[tb3_0/turtlebot3_core-1]: started with pid [1556]
process[tb3_0/turtlebot3_lds-2]: started with pid [1557]
process[tb3_0/turtlebot3_diagnostics-3]: started with pid [1558]
[INFO] [1575524876.012259]: ROS Serial Python Node
[INFO] [1575524876.097244]: Connecting to /dev/ttyACM0 at 115200 baud
[INFO] [1575524878.264296]: Note: publish buffer size is 1024 bytes
[INFO] [1575524878.266896]: Setup publisher on sensor_state [turtlebot3_msgs/SensorState]
[INFO] [1575524878.295215]: Setup publisher on firmware_version [turtlebot3_msgs/VersionInfo]
[INFO] [1575524878.456168]: Setup publisher on imu [sensor_msgs/Imu]
[INFO] [1575524878.475331]: Setup publisher on cmd_vel_rc100 [geometry_msgs/Twist]
[INFO] [1575524878.537769]: Setup publisher on odom [nav_msgs/Odometry]
[INFO] [1575524878.554483]: Setup publisher on joint_states [sensor_msgs/JointState]
[INFO] [1575524878.575558]: Setup publisher on battery_state [sensor_msgs/BatteryState]
[INFO] [1575524878.598518]: Setup publisher on magnetic_field [sensor_msgs/MagneticField]
[INFO] [1575524884.270511]: Setup publisher on /tf [tf/tfMessage]
[INFO] [1575524884.309809]: Note: subscribe buffer size is 1024 bytes
[INFO] [1575524884.313145]: Setup subscriber on cmd_vel [geometry_msgs/Twist]
[INFO] [1575524884.355058]: Setup subscriber on sound [turtlebot3_msgs/Sound]
[INFO] [1575524884.386238]: Setup subscriber on motor_power [std_msgs/Bool]
[INFO] [1575524884.421414]: Setup subscriber on reset [std_msgs/Empty]
[WARN] [1575524884.450769]: Failed to get param: timeout expired
[INFO] [1575524884.455505]: Setup TF on Odometry [odom]
[INFO] [1575524884.459867]: Setup TF on IMU [imu_link]
[INFO] [1575524884.464465]: Setup TF on MagneticField [mag_link]
[INFO] [1575524884.468976]: Setup TF on JointState [base_link]
[INFO] [1575524884.493382]: --------------------------
[INFO] [1575524884.497909]: Connected to OpenCR board!
[INFO] [1575524884.502435]: This core(v1.2.3) is compatible with TB3 Burger
[INFO] [1575524884.507188]: --------------------------
[INFO] [1575524884.511674]: Start Calibration of Gyro
[INFO] [1575524884.911221]: Calibration End
^C[tb3_0/turtlebot3_diagnostics-3] killing on exit
[tb3_0/turtlebot3_lds-2] killing on exit
[tb3_0/turtlebot3_core-1] killing on exit
[INFO] [1575525170.984556]: Send tx stop request
^Cshutting down processing monitor...
... shutting down processing monitor complete
done

 
已邀请:

lalala

赞同来自:

解决方法
 
ubuntu@burger:~$ locate SerialClient
/opt/ros/kinetic/lib/python2.7/dist-packages/rosserial_python/SerialClient.py
/opt/ros/kinetic/lib/python2.7/dist-packages/rosserial_python/SerialClient.pyc

ubuntu@burger:~$ sudo vim /opt/ros/kinetic/lib/python2.7/dist-packages/rosserial_python/SerialClient.py
修改341行的 timeout值 增大延时时间
def __init__(self, port=None, baud=57600, timeout=5.0, fix_pyserial_for_test=False):


重新启动小车及查看tf树
 
启动后OpenCR反馈出来的信息
 

[INFO] [1575526873.772037]: Setup TF on Odometry [tb3_0/odom]
[INFO] [1575526873.778939]: Setup TF on IMU [tb3_0/imu_link]
[INFO] [1575526873.785893]: Setup TF on MagneticField [tb3_0/mag_link]
[INFO] [1575526873.791598]: Setup TF on JointState [tb3_0/base_link]
 

frames.png

 
ubuntu@burger:~$ ROS_NAMESPACE=tb3_0 roslaunch turtlebot3_bringup turtlebot3_robot.launch multi_robot_name:="tb3_0" set_lidar_frame_id:="tb3_0/base_scan"
... logging to /home/ubuntu/.ros/log/bfe964d6-1722-11ea-8909-000c2965f318/roslaunch-burger-1750.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://192.168.0.25:39079/

SUMMARY
========

PARAMETERS
* /rosdistro: kinetic
* /rosversion: 1.12.14
* /tb3_0/turtlebot3_core/baud: 115200
* /tb3_0/turtlebot3_core/port: /dev/ttyACM0
* /tb3_0/turtlebot3_core/tf_prefix: tb3_0
* /tb3_0/turtlebot3_lds/frame_id: tb3_0/base_scan
* /tb3_0/turtlebot3_lds/port: /dev/ttyUSB0

NODES
/tb3_0/
turtlebot3_core (rosserial_python/serial_node.py)
turtlebot3_diagnostics (turtlebot3_bringup/turtlebot3_diagnostics)
turtlebot3_lds (hls_lfcd_lds_driver/hlds_laser_publisher)

ROS_MASTER_URI=http://192.168.0.184:11311

process[tb3_0/turtlebot3_core-1]: started with pid [1759]
process[tb3_0/turtlebot3_lds-2]: started with pid [1760]
process[tb3_0/turtlebot3_diagnostics-3]: started with pid [1761]
[INFO] [1575526868.439246]: ROS Serial Python Node
[INFO] [1575526868.512420]: Connecting to /dev/ttyACM0 at 115200 baud
[INFO] [1575526870.655526]: Note: publish buffer size is 1024 bytes
[INFO] [1575526870.658004]: Setup publisher on sensor_state [turtlebot3_msgs/SensorState]
[INFO] [1575526870.673665]: Setup publisher on firmware_version [turtlebot3_msgs/VersionInfo]
[INFO] [1575526870.753997]: Setup publisher on imu [sensor_msgs/Imu]
[INFO] [1575526870.776517]: Setup publisher on cmd_vel_rc100 [geometry_msgs/Twist]
[INFO] [1575526870.799170]: Setup publisher on odom [nav_msgs/Odometry]
[INFO] [1575526870.826280]: Setup publisher on joint_states [sensor_msgs/JointState]
[INFO] [1575526870.844346]: Setup publisher on battery_state [sensor_msgs/BatteryState]
[INFO] [1575526870.857858]: Setup publisher on magnetic_field [sensor_msgs/MagneticField]
[INFO] [1575526873.165272]: Setup publisher on /tf [tf/tfMessage]
[INFO] [1575526873.200181]: Note: subscribe buffer size is 1024 bytes
[INFO] [1575526873.201801]: Setup subscriber on cmd_vel [geometry_msgs/Twist]
[INFO] [1575526873.227525]: Setup subscriber on sound [turtlebot3_msgs/Sound]
[INFO] [1575526873.257460]: Setup subscriber on motor_power [std_msgs/Bool]
[INFO] [1575526873.299892]: Setup subscriber on reset [std_msgs/Empty]
[INFO] [1575526873.772037]: Setup TF on Odometry [tb3_0/odom]
[INFO] [1575526873.778939]: Setup TF on IMU [tb3_0/imu_link]
[INFO] [1575526873.785893]: Setup TF on MagneticField [tb3_0/mag_link]
[INFO] [1575526873.791598]: Setup TF on JointState [tb3_0/base_link]
[INFO] [1575526873.805208]: --------------------------
[INFO] [1575526873.811731]: Connected to OpenCR board!
[INFO] [1575526873.818080]: This core(v1.2.3) is compatible with TB3 Burger
[INFO] [1575526873.824910]: --------------------------
[INFO] [1575526873.831345]: Start Calibration of Gyro
[INFO] [1575526876.331011]: Calibration End

参考资料
 

要回复问题请先登录注册