Ask Your Question
0

Moving Lego NXT's motor

asked 2011-08-10 09:46:32 -0500

Rafael Aroca gravatar image

updated 2014-01-28 17:10:11 -0500

ngrennan gravatar image

I've been playing with ROS+Lego NXT and after successfully playing with the sensors I got stuck trying to move one motor.

The only parameter I found on nxt_msgs related to that is JointCommand, but JointCommand only has "effort".

So I tried:

rostopic pub /joint_command nxt_msgs/JointCommand '{name: 'motor', effort: 10}'

And confirmed that this value changed with:

rostopic echo joint_command

name: motor effort: 10.0

But no movement. I also tried the nxt_teleop demo, but no matter the arrow key I press, none of the motor move.

I also tried the steps described in this post, but had no success ( http://answers.ros.org /question/486/trouble-following-lego-nxt-tutorials)

Any ideas? thanks

edit retag flag offensive close merge delete

Comments

were you able to run the test on the installation page (http://www.ros.org/wiki/nxt/Installation)? or run the first tutorial (http://www.ros.org/wiki/nxt_ros/Tutorials/Getting%20started)
mmwise gravatar image mmwise  ( 2011-08-10 10:03:21 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2011-08-11 07:35:38 -0500

Jhatch gravatar image

Try using the command rxgraph when your system is running to see what is subscribing and publishing in order to better diagnose the problem.

nxt_teleop should publish to cmd_vel which publishes to base_controller which publishes to joint_command

There are 2 tutorials online for Teleoperation, I found the nxt_teleop (http://www.ros.org/wiki/nxt_teleop) works, and I have not had success with nxt_assisted_teleop.

So I run roscore, a robot.launch file (which reads robot.yaml for parameters), and then I launch teleop_keyboard.launch from the directory .../stacks/nxt_apps/nxt_teleop and then use the arrow keys to drive the nxt.

edit flag offensive delete link more
0

answered 2013-02-12 06:22:57 -0500

dolphinfafa gravatar image

updated 2013-02-12 06:24:04 -0500

I tried to control NXT too.

The command to control 'motor' node depends on the node name which written in the robot.yaml.

For example, in my 'robot.yaml', the name for the 'motor' is 'l_motor_joint'.

So I tried :

rostopic pub -1 joint_command nxt_msgs/JointCommand -- l_motor_joint XX (XX is a float number)

It works.

I tried the nxt_teleop too, but it doesn't work.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2011-08-10 09:46:32 -0500

Seen: 846 times

Last updated: Feb 12 '13