Comments (4)
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:
-
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. -
roscore needs reset. Until Issue #11 is resolved, I recommend always starting runs with a fresh ROS instance via a
roscore
call. -
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.
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.
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.
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)
- Support array fields types.
- Clean up TCPROS and how Publisher and Subscriber use it. HOT 1
- Use LESS for css.
- Start and stop ros in each test.
- Provide interface to Parameter Server
- Integrate with roslaunch. HOT 1
- Support TF HOT 1
- v0.1.x ideas HOT 18
- (API improvement proposal) The code I would have like to write to move my turtle in turtlesim HOT 7
- Fix MD5 sum calculations of messages. HOT 4
- Ideas for ~0.1.2 HOT 6
- Publish to multiple subscribers HOT 8
- Support ROS Fuerte
- Msg with encapsulated with std_msgs doesn't works HOT 4
- [tcppros - subscriber] connection header are checked for every tcp packet HOT 2
- [tcpros -subscriber ] receiving a big message failed du to tcp window HOT 2
- /opt/ros/jade/stacks HOT 1
- Why deprecated HOT 6
- Transfer rosnodejs NPM package to RethinkRobotics-opensource/rosjs HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rosnodejs.