Cannot connect to ROS master and connect my Baxter robot...

13 views (last 30 days)
Hi,i am a Chinese student and ye here again.
Recently,I got some problem and I have seen similar problems and solutions ,but the problem still a problem.
Accoding to
What i have done are as follows:
in matlab :
}1~]G8DPU$JI9SV_4~RED)4.png
in my hosts file from C:\Windows\System32\drivers\etc.
_7@3DF2F_2DE]R{W(`{4M[D.png
and also i have the toolbox ,the firewall is closed .i download the communicator class from web,the code named StartHere_ExampleScript.m are as follows :
and it can connect my virtual machine ROS master ip 192.168.1.129,so i decide to connect my real Baxter robot ,but it is failed. ^--^//
So, I really need help to solve this problem. Then I can continue to learn and study the baxter robot.
Can you help me if you have solved a similar problem? I really appreciate your help.
Best wishes!
StartHere_ExampleScript - Script to test Baxter Communicator class
% Notes:
% 0) Execute this script section by section
% 1) If you are running on a laptop, you might need to disable your
% antivirus software.
% 2) Make sure to turn on Baxter with the E-Stop released.
% 3) This script will DISABLE Baxter's Collision Avoidance
% 4) Baxter's IP should be declared in the hosts file in C:\Windows\System32\drivers\etc
% 5) check that your antivirus is off and E-Stop is disabled
% Copyright 2017 The MathWorks, Inc
%% Connect to ROS MASTER
% Change '011310P0010.local' to your Baxter's hostname
% NodeHost should be the IP address of your laptop or host machine
% rosinit('011310P0010.local','NodeHost','192.168.244.129')
%% Create object of Baxter Communicator class
% To connect to hardware:
% for hardware
rosinit('011602P0019.local','NodeHost','192.168.1.128')
%%
% To connect to simulation:
%bc = BaxterCommWithSim(true); % for simulation
%rosinit('192.168.1.129')
%% Turn on Servos
enable(bc);
%% Start timer to periodically update the joint commands
%baxterStartTimerForRobot;
baxterStartTimerForSim;
%% Untuck both arms
untuck(bc, 3);
...............

Accepted Answer

Cam Salzberger
Cam Salzberger on 10 Dec 2018
Hey John,
Sorry, I just was answering your other question with general strategies, but it looks like you've at least tried some of them here.
The thing that really stands out is that you've indicated that your computer (that's running MATLAB) has IP address 192.168.1.128. You are also trying to connect to the ROS Master computer at that hostname, but your hosts files shows it resolves to the same IP. If that hostname is supposed to go to the Baxter, then you need the Baxter's IP address in the hosts file, not your own computer's.
If that is the Baxter's IP address, then you should not be setting that to the ROS_IP environment variable or using it as the NodeHost argument.
-Cam
  3 Comments
Cam Salzberger
Cam Salzberger on 10 Dec 2018
Hey John,
I haven't personally used Baxter, but based on a quick skim of their network information page, it seems like Baxter should be advertising its own hostname to IP address resolution over the network. So, if you manually added that address to your hosts file, maybe removing it will allow your computer to recognize the SERIAL.local hostname to resolve to the correct IP. You'll probably need to restart your computer (and possibly Baxter?) after removing that line from hosts though.
-Cam
snow John
snow John on 11 Dec 2018
Dear Cam, I have to thank you again for your help.
After change the IP address in my hosts file with Baxter's ip
Now I can control the Baxter robot through MATLAB with code named StartHere_ExampleScript.m .
rosinit('011602P0019.local','NodeHost','192.168.1.128')
bc = BaxterCommWithSim(true);
enable(bc);
baxterStartTimerForSim;
tuck(bc, 3);
.........
The following is the IP address I modified in the hosts file.
TFAGOPTG4}{D%K]9FS2SOUY.png
sudo apt-get install avahi-autoipd avahi-daemon avahi-utils
avahi-resolve-host-name 011602P0019.local
and ip address can be resolved as follows
011602P0019.local 192.168.1.100
I run those code on my Classmate 's computer ThinkPad /Lenove,which one can directly connect the Baxter with ROS.
Thank you again,Cam!
-John

Sign in to comment.

More Answers (0)

Categories

Find more on Network Connection and Exploration in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!