Coder Social home page Coder Social logo

Comments (5)

smoya23 avatar smoya23 commented on July 2, 2024

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

from kinova-ros.

aodongdong avatar aodongdong commented on July 2, 2024

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.

  1. I set left arm ip to 192.168.100.44, and right arm to 192.168.100.45. My local machine ip is 192.168.100.30. I checked for the connection by ping, then i use the launch file to bringup, with .yaml files modified. It doesn't work with the same error as described above.
  2. According to your suggestion, i added robot_ip and modified kinova_comm.cpp file. Now, the .yaml is
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:
1
2

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:
image

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.

from kinova-ros.

smoya23 avatar smoya23 commented on July 2, 2024

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 ?

from kinova-ros.

aodongdong avatar aodongdong commented on July 2, 2024

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.)

from kinova-ros.

smoya23 avatar smoya23 commented on July 2, 2024

@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.

from kinova-ros.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.