Forums Niryo One Troubleshooting Need help on how to structure goals to send to the robot via roslib / rosbridge

Viewing 1 post (of 1 total)
  • Author
    Posts
  • jillians
    Participant
    Post count: 4

    My last post with info got removed somehow. Attempted to reconstruct it all:

    Basically trying to figure out how to to send a ROS goal using roslib.js, but im totally lost on how to structure it.

    Here is my code:
    module.exports.testGoal = () => {
    const ROSLIB = require(“roslib”);
    const ros = require(“../services/ROS”);

    try {
    console.log(“SET GOAL: “);
    var actionClient = new ROSLIB.ActionClient({
    ros: ros,
    serverName: “/niryo_one/commander/robot_action”,
    actionName: “niryo_one_msgs/RobotMoveAction/joints”,
    });

    const message = new ROSLIB.Message({
    cmd_type: 1,
    joints: [1.0, 0.0, 0.0, 0.0, 0.0, 0.0],
    });

    const goal = new ROSLIB.Goal({
    actionClient: actionClient,
    goalMessage: message,
    });

    console.log(“SEND GOAL!”);
    goal.send();
    console.log(goal);

    goal.on(“result”, (result) => {
    console.log(“GOAL RESULT: “, result);
    });
    goal.on(“feedback”, (result) => {
    console.log(result);
    });
    } catch (err) {
    console.log(err);
    }
    };

    When i look at the python api, ( I don’t think i can post direct links without this post getting flagged )
    Trying to replicate w/ my code:
    Line 281 in niyro_one_api.py

    But RobotMoveGoal and RobotMoveAction ( imported on lines 28 / 29 ) don’t exist in Niryo One Messages / msg

    I can see the positional feedback with my script by subscribing to the ros topics, but that’s all i’ve been able to do.

    I only need to do two things,
    Move joints, and Cancel move joints.
    Please help. Sorry if this is spam, it just looks i triggered a bug or some other kind of moderation action with my last post unintentionally.

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.