Closed aodongdong closed 5 months ago
Hi @aodongdong ,
By default, the Kinova Ethernet API assumes the default IP address for the robot as 192.168.100.11 https://github.com/Kinovarobotics/kinova-ros/blob/noetic-devel/kinova_driver/src/kinova_comm.cpp#L88. Seeing as you modified the addresses of your robots, this is probably why the Kinova API is unable to initialize. One easy way to get around this with your current setup would be to add an additional parameter to each one of your (left/right)_robot_parameters.yaml files such as :
ethernet: {
local_machine_IP: 192.168.1.30,
subnet_mask: 255.255.255.0,
local_cmd_port: 25000,
local_broadcast_port: 25025,
robot_IP: <your_robot_ip>
}
and then fetch it in the kinova_comm.cpp file :
//Set ethernet parameters
EthernetCommConfig ethernet_settings;
std::string local_IP,subnet_mask,robot_IP;
int local_cmd_port,local_bcast_port;
node_handle.getParam("ethernet/local_machine_IP", local_IP);
node_handle.getParam("ethernet/robot_IP", robot_IP);
node_handle.getParam("ethernet/subnet_mask", subnet_mask);
node_handle.getParam("ethernet/local_cmd_port", local_cmd_port);
node_handle.getParam("ethernet/local_broadcast_port", local_bcast_port);
ethernet_settings.localCmdport = local_cmd_port;
ethernet_settings.localBcastPort = local_bcast_port;
ethernet_settings.localIpAddress = inet_addr(local_IP.c_str());
ethernet_settings.subnetMask = inet_addr(subnet_mask.c_str());
ethernet_settings.rxTimeOutInMs = 1000;
ethernet_settings.robotIpAddress = inet_addr(robot_IP.c_str());
ethernet_settings.robotPort = 55000;
You will need to rebuild the ROS workspace after doing these changes. Also, make sure that all of the ip addresses are under the same subnet mask. I have not tested this yet since I do not currently have access to an arm but it shouldn't break anything. Let me know if this works for you, don't hesitate if you get any other errors!
Best, Santiago
Hello, @smoya23
Thank you for your suggestion! Unfortunately, it doesn't work after i modified these parameters&codes according to your suggestion.
Specifically, I have tried two approaches.
ethernet: {
local_machine_IP: 192.168.100.30,
subnet_mask: 255.255.255.0,
local_cmd_port: 25015,
local_broadcast_port: 25025,
robot_IP: 192.168.100.44
}
for left arm, and
ethernet: {
local_machine_IP: 192.168.100.30,
subnet_mask: 255.255.255.0,
local_cmd_port: 25015,
local_broadcast_port: 25025,
robot_IP: 192.168.100.45
}
for right arm.
see the settings as follows:
Additionally, i changed launch file to
<launch>
<arg name="kinova_robotType" default="j2s6s300" />
<arg name="left_robotName" default="left_arm"/>
<arg name="right_robotName" default="right_arm"/>
<arg name="kinova_robotSerial" default="not_set" />
<arg name="use_jaco_v1_fingers" default="false" />
<arg name="feedback_publish_rate" default="0.01" />
<!-- If the node handles multiple robots uncomment this and configure /config/multiple_robots.yaml" -->
<rosparam file="$(find kinova_bringup)/launch/config/multiple_robots_test.yaml" command="load" />
<node name="$(arg right_robotName)_driver" pkg="kinova_driver" type="kinova_arm_driver" output="screen" cwd="node" args="$(arg kinova_robotType)" respawn="true">
<rosparam file="$(find kinova_bringup)/launch/config/right_kinova.yaml" command="load" />
<param name="serial_number" value="PJ00900006521429R" />
<param name="robot_name" value="$(arg right_robotName)" />
<param name="robot_type" value="$(arg kinova_robotType)" />
<param name="use_jaco_v1_fingers" value="$(arg use_jaco_v1_fingers)" />
<param name="status_interval_seconds" value="$(arg feedback_publish_rate)" />
<remap from="/right_arm_driver/out/joint_state" to="/joint_states" />
</node>
<node name="$(arg left_robotName)_driver" pkg="kinova_driver" type="kinova_arm_driver" output="screen" cwd="node" args="$(arg kinova_robotType)" respawn="true">
<rosparam file="$(find kinova_bringup)/launch/config/left_kinova.yaml" command="load" />
<param name="serial_number" value="PJ00900006521429L" />
<param name="robot_name" value="$(arg left_robotName)" />
<param name="robot_type" value="$(arg kinova_robotType)" />
<param name="use_jaco_v1_fingers" value="$(arg use_jaco_v1_fingers)" />
<param name="status_interval_seconds" value="$(arg feedback_publish_rate)" />
<remap from="/left_arm_driver/out/joint_state" to="/joint_states" />
</node>
</launch>
(which will launch right arm node first)
the error comes:
Note that we can bringup either of the two through ethernet. When one of them is brought up, we can find 2 devices was found by the upper computer. Subnet mask is set to 255.255.255.0 for both arms.
Hi @aodongdong,
Sorry to hear it did not work! One thing I did not mention but should be done also, is to change the port numbers for each arm driver. So in either one of your left or right arm .yaml file, change the values for local_cmd_port
and local_broadcast_port
so that they differ from the other arm's config. Also, from your screenshots, I see that the left arm's driver is unable to launch, are you having the same issue with the right arm or is the right arm driver launching correctly ?
Thanks for your kind suggestion @smoya23. The problem has been solved after setting different port numbers for each arm driver. Both arms can be launched at the same time through ethernet.
Specifically, I changed local_cmd_port
and local_broadcast_port
, and i have added robotport
param in .yaml so that it can be fetched in the kinova_comm.cpp.
(PS: The screenshots showcase two arms can not be launched concurrently.)
@aodongdong Awesome, great to hear that you were able to solve the problem! Don't hesitate to open a new issue if you encounter any other problems.
Hello,
I use two kinova arms in ROS. One is left arm with the ip 192.168.5.10, the other is right arm with the ip 192.168.1.31. They are in the different local area network. We can bringup both arms as long as we can ping them.
However, using two USB-to-Ethernet ports to connect to the upper computer is usually unstable (one usually is not connected) when the robotic arm is powered on. Hence, i use the Network switch to make two arms in the same local area network. (The ip was changed to 192.168.1.29 for left arm).
My local machine ip is 192.168.1.30. Then i use the following launch file to bringup:
left_robot_parameters.yaml is:
right_robot_parameters.yaml is:
multiple_robots.yaml is:
However, when two arms are in the same local area network, the error occurs:
It seems that two arms can not be bringup in the same time in the same local area network.
Are there any suggestions to solve it?