Coder Social home page Coder Social logo

Comments (1)

felixmaisonneuve avatar felixmaisonneuve commented on September 25, 2024

Hi @NAEE09,

The error you get is printed here :

void KinovaComm::getFingerPositions(FingerAngles &fingers)
{
boost::recursive_mutex::scoped_lock lock(api_mutex_);
CartesianPosition kinova_cartesian_position;
memset(&kinova_cartesian_position, 0, sizeof(kinova_cartesian_position)); // zero structure
int result = kinova_api_.getCartesianPosition(kinova_cartesian_position);
if (result != NO_ERROR_KINOVA)
{
throw KinovaCommException("Could not get Cartesian finger position", result);
}
if (num_fingers_ == 2)
{
kinova_cartesian_position.Fingers.Finger3 = 0.0;
}
fingers = FingerAngles(kinova_cartesian_position.Fingers);
}

Since you do not have a gripper, this API call will always fail, so you have to make sure this is never called in your driver.

The kinova_arm driver constantly ppublishes info about the arm, and I think this is were it fails.

This is the function in the driver that updates the topics of your ROS driver :

void KinovaArm::statusTimer(const ros::TimerEvent&)
{
publishJointAngles();
publishToolPosition();
publishToolWrench();
publishFingerPosition();
}

You need to remove the publishFingerPosition() function (that uses getFingerPositions) and you need to modify the publishJointAngles() function also.

In publishJointAngles(), remove every mention to fingers :

FingerAngles fingers;
kinova_comm_.getFingerPositions(fingers);

if(finger_number_==2)
{
// proximal phalanges
joint_state.position[joint_total_number_-4] = fingers.Finger1 * finger_conv_ratio_ * M_PI/180;
joint_state.position[joint_total_number_-3] = fingers.Finger2 * finger_conv_ratio_ * M_PI/180;
// distal phalanges
joint_state.position[joint_total_number_-2] = 0;
joint_state.position[joint_total_number_-1] = 0;
}
else if(finger_number_==3)
{
// proximal phalanges
joint_state.position[joint_total_number_-6] = fingers.Finger1 * finger_conv_ratio_ * M_PI/180;
joint_state.position[joint_total_number_-5] = fingers.Finger2 * finger_conv_ratio_ * M_PI/180;
joint_state.position[joint_total_number_-4] = fingers.Finger3 * finger_conv_ratio_ * M_PI/180;
// distal phalanges
joint_state.position[joint_total_number_-3] = 0;
joint_state.position[joint_total_number_-2] = 0;
joint_state.position[joint_total_number_-1] = 0;
}

If you remove all of this, your driver should be able to launch correctly.

For the kinovaComm::setCartesianPosition(), can you share a brief sample of your code? I am not sure I fully understand what you are doing

Regards,
Felix

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.