GithubHelp home page GithubHelp logo

Cannot move my turtle :'( about rosnodejs HOT 4 OPEN

baalexander avatar baalexander commented on June 19, 2024
Cannot move my turtle :'(

from rosnodejs.

Comments (4)

baalexander avatar baalexander commented on June 19, 2024

I have done all of my robot testing using a TurtleBot, but I haven't namespaced my topics yet (see Issue #5).

First, I have been using the cmd_vel topic and geometry_msgs/Twist for movement. The web app has the exact example I use to move the TurtleBot over the web. I believe turtlesim is just a reduced verions of this (or wrapper around this).

One of the ways I like to debug --- that may help here --- is to run rostopic echo [mytopic] and see if it prints out my published message.

A few possible issues:

  1. The turtle1/ namespace isn't supported by rosnodejs. Proper namespace support is still on the todo list, right now it assumes most topics are in the root namespace.

  2. roscore needs reset. Until Issue #11 is resolved, I recommend always starting runs with a fresh ROS instance via a roscore call.

  3. Topic name or message input is off. Ros.org is down for me right now, but there's a chance the expected topic is turtle1/cmd_vel if it's like other parts of ROS.

Please let me know if any luck. I will start including the turtle sims in the development testing for the v0.1.x branch.

from rosnodejs.

temsa avatar temsa commented on June 19, 2024

Here is what outputs from rxgraph when selecting the turtlesim node :

Node [/turtlesim]
Publications: 
 * /turtle1/color_sensor [turtlesim/Color]
 * /rosout [rosgraph_msgs/Log]
 * /turtle1/pose [turtlesim/Pose]

Subscriptions: 
 * /turtle1/command_velocity [unknown type]

Services: 
 * /turtle1/teleport_absolute
 * /turtlesim/get_loggers
 * /turtlesim/set_logger_level
 * /reset
 * /spawn
 * /clear
 * /turtle1/set_pen
 * /turtle1/teleport_relative
 * /kill
Pid: 4718
Connections:
 * topic: /rosout
    * to: /rosout
    * direction: outbound
    * transport: TCPROS

If I understand well, I have to use the "turtle1/" namespace, and turtlesim does not listen for "cmd_vel" generic messages, so I just cannot talk to my turtle until "1)" is resolved ?

from rosnodejs.

baalexander avatar baalexander commented on June 19, 2024

I reproduced your issue locally tonight.

I ran rostopic echo /topic1/command_velocity and nothing printed out. I tried it with geometry_msgs and std_msgs and same issue.

Then I wrapped topic.publish in a setTimeout(..., 1000) call and rostopic was able to print out the message. You should be able to send messages okay with that timeout, but I still get a Connection to socket not established error when connecting to the simulator.

I plan to spend most of the weekend implementing the new API (minus message generation) in the v0.1.x branch. Some backend design changes that will go in with this is fixing a couple timing issues that have came up related to either TCP port availability or publishing a message before the socket has connected (the issue here).

Thanks for your patience.

from rosnodejs.

temsa avatar temsa commented on June 19, 2024

I don't know if you are used to it, I don't don't get if it is necessary in your case or not, but complex timing issues are often easier to manage using promises IMHO.

from rosnodejs.

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.