Hi there, I cannot make my turtlebot3 move.
I'm using ROS 1.12.12 on my Turtlebot3 Waffle Pi with OpenCR v1.1.2 and am communicating throught Matlab R2018a (with ROSTtoolbox) on a lenovo thinkpad x121e with win 7 ultimate x64 system. Using ethernet cable, all firewalls deactivated.
Turtlebot3 ip is 169.254.96.117, Matlab laptop uses 169.254.96.70, they ping each other.
I already checked https://answers.ros.org/question/272722/turtlebot-wont-move-matlab/ and https://de.mathworks.com/matlabcentral/answers/119559-why-is-the-ros-subscriber-callback-in-matlab-not-triggered-when-messages-are-published-from-an-exter and https://nl.mathworks.com/matlabcentral/answers/196911-use-matlab-robotics-system-toolbox-to-receive-ros-message but all those answers didn't solve my problem.
I am able to recieve compressed images from the pi camera.
What I do:
Starting terminal on Turtlebot3
pi@lane_assist:~ $ sudo nano ~/.bashrc
The last 3 lines of this file are
export ROS_MASTER_URI=http://169.254.96.117:11311
export ROS_IP=169.254.96.117
export TURTLEBOT3_MODEL=waffle_pi
Then I'm launching ROS on Turtlebot3
pi@lane_assist:~ $ roslaunch turtlebot3_bringup turtlebot3_robot.launch
...
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://169.254.96.117:36215/
SUMMARY
========
PARAMETERS
* /rosdistro: kinetic
* /rosversion: 1.12.12
* /turtlebot3_core/baud: 115200
* /turtlebot3_core/port: /dev/ttyACM0
* /turtlebot3_lds/frame_id: base_scan
* /turtlebot3_lds/port: /dev/ttyUSB0
NODES
/
turtlebot3_core (rosserial_python/serial_node.py)
turtlebot3_diagnostics (turtlebot3_bringup/turtlebot3_diagnostics)
turtlebot3_lds (hls_lfcd_lds_driver/hlds_laser_publisher)
auto-starting new master
process[master]: started with pid [900]
ROS_MASTER_URI=http://169.254.96.117:11311
setting /run_id to 6b1f4796-5e5e-11e8-9737-b827eb81deb2
process[rosout-1]: started with pid [913]
started core service [/rosout]
process[turtlebot3_core-2]: started with pid [916]
process[turtlebot3_lds-3]: started with pid [917]
process[turtlebot3_diagnostics-4]: started with pid [918]
[INFO] [1527062028.753037]: ROS Serial Python Node
[INFO] [1527062028.779238]: Connecting to /dev/ttyACM0 at 115200 baud
[INFO] [1527062031.090808]: Note: publish buffer size is 1024 bytes
[INFO] [1527062031.092832]: Setup publisher on sensor_state [turtlebot3_msgs/SensorState]
[INFO] [1527062031.104666]: Setup publisher on version_info [turtlebot3_msgs/VersionInfo]
[INFO] [1527062031.117409]: Setup publisher on imu [sensor_msgs/Imu]
[INFO] [1527062031.136734]: Setup publisher on cmd_vel_rc100 [geometry_msgs/Twist]
[INFO] [1527062031.196269]: Setup publisher on odom [nav_msgs/Odometry]
[INFO] [1527062031.207955]: Setup publisher on joint_states [sensor_msgs/JointState]
[INFO] [1527062031.220119]: Setup publisher on battery_state [sensor_msgs/BatteryState]
[INFO] [1527062031.234520]: Setup publisher on magnetic_field [sensor_msgs/MagneticField]
[INFO] [1527062035.993428]: Setup publisher on /tf [tf/tfMessage]
[INFO] [1527062036.011202]: Note: subscribe buffer size is 1024 bytes
[INFO] [1527062036.013037]: Setup subscriber on cmd_vel [geometry_msgs/Twist]
[INFO] [1527062036.036048]: Setup subscriber on sound [turtlebot3_msgs/Sound]
[INFO] [1527062036.054081]: Setup subscriber on motor_power [std_msgs/Bool]
[INFO] [1527062036.074894]: Setup subscriber on reset [std_msgs/Empty]
[INFO] [1527062036.103111]: ------turtlebot matla move--------------------
[INFO] [1527062036.108906]: Connected to OpenCR board!
[INFO] [1527062036.557876]: This core(v1.1.2) is compatible with TB3 Waffle or Waffle Pi
[INFO] [1527062036.561891]: --------------------------
[INFO] [1527062036.565490]: Start Calibration of Gyro
[INFO] [1527062036.569355]: Calibration End
[ WARN] [1527062037.011487913]: Check OpenCR update and change your firmware!!
And then I'm starting MATLAB, using the following Code:
ipadress = '169.254.96.117'
rosinit(ipadress)
rostopic list
velsub=rossubscriber('/cmd_vel')
velpub = rospublisher('/cmd_vel',rostype.geometry_msgs_Twist)
velmsg = rosmessage(velpub)
velmsg.Linear.X = 0.01
velmsg.Angular.Z = 0.01
send(velpub,velmsg)
The Code taken form the command window is:
ipadress = '169.254.96.117'
ipadress =
'169.254.96.117'
rosinit(ipadress)
Initializing global node /matlab_global_node_48143 with NodeURI http://169.254.96.70:50988/
rostopic list
/battery_state
/cmd_vel
/cmd_vel_rc100
/diagnostics
/imu
/joint_states
/magnetic_field
/motor_power
/odom
/reset
/rosout
/rosout_agg
/rpms
/scan
/sensor_state
/sound
/tf
/version_info
velsub=rossubscriber('/cmd_vel')
velsub =
Subscriber with properties:
TopicName: '/cmd_vel'
MessageType: 'geometry_msgs/Twist'
LatestMessage: [0×1 Twist]
BufferSize: 1
NewMessageFcn: []
velpub = rospublisher('/cmd_vel',rostype.geometry_msgs_Twist)
velpub =
Publisher with properties:
TopicName: '/cmd_vel'
IsLatching: 1
NumSubscribers: 0
MessageType: 'geometry_msgs/Twist'
velmsg = rosmessage(velpub)
velmsg.Linear.X = 0.01
velmsg.Angular.Z = 0.01
send(velpub,velmsg)
velmsg =
ROS Twist message with properties:
MessageType: 'geometry_msgs/Twist'
Linear: [1×1 Vector3]
Angular: [1×1 Vector3]
Use showdetails to show the contents of the message
velmsg =
ROS Twist message with properties:
MessageType: 'geometry_msgs/Twist'
Linear: [1×1 Vector3]
Angular: [1×1 Vector3]
Use showdetails to show the contents of the message
velmsg =
ROS Twist message with properties:
MessageType: 'geometry_msgs/Twist'
Linear: [1×1 Vector3]
Angular: [1×1 Vector3]
Use showdetails to show the contents of the message
rostopic info /cmd_vel
Type: geometry_msgs/Twist
Publishers:
* /matlab_global_node_90049 (http://169.254.96.70:51028/)
Subscribers:
* /turtlebot3_core (http://169.254.96.117:35571/)
* /matlab_global_node_90049 (http://169.254.96.70:51028/)
What am I missing? Any help would be wonderful.
Thank you!