Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix example launch files #11

Open
dabakix8 opened this issue Feb 18, 2017 · 19 comments
Open

Fix example launch files #11

dabakix8 opened this issue Feb 18, 2017 · 19 comments
Assignees
Labels

Comments

@dabakix8
Copy link

dabakix8 commented Feb 18, 2017

Hello.

I am trying to start motor with using motor.launch which is provided as an example. But it does not work for me. Actually, I've already checked closed thread #2 and #6, but I am still confusing.

My situation is the follwoings:

  1. My PC and ev3 can communicate vis ssh.
  2. ultrasonic.launch works. I could see the value from ultrasonic sensor.

I compiled every packages which provided in "Hacks4ROS/h4r_ev3_ctrl " in my PC. So, I am thinking that
it is possible that when I run "roslaunch motors.lauch", "h4r_ev3_manager" in my PC is started.

When I do "rosnode list", I can see "/ev3dev/ev3_manager_node", but the following command does not work.
rostopic pub /ev3dev/OutPortA/command std_msgs/Float64 "data: 5.0"

Do I need to modify "motors.launch" according to my environment? I need a hint.

Thank you.

md

@dabakix8
Copy link
Author

dabakix8 commented Feb 19, 2017

Hello.

I resolved it. Actually, it was memtioned in #2, but it was not clear. Concretely, what I did is below.

I deleted the following tag from the exapmle of motor.launch, then it works.

"node pkg="h4r_ev3_manager" type="ev3_manager_node" name="ev3_manager_node" output="screen""
"/node"

I recommend the node tage above should be deleted from the example to avoid misunderstanding.

Thank you.

md

@cyborg-x1
Copy link
Member

Oh yeah that's right there are some issues in that one .. it should not start the manager node ...
That's probably left from testing it myself some time ago

@cyborg-x1 cyborg-x1 self-assigned this Feb 20, 2017
@cyborg-x1 cyborg-x1 added the bug label Feb 20, 2017
@cyborg-x1 cyborg-x1 changed the title motors.launch does not work. I've checked closed #2, #6. Fix example launch files Feb 20, 2017
@yrosascu
Copy link

Hello,

Have you seen the data of your ultrasonic sensor? how did you do ? because I am trying to ,test this sensor and I havent receive any data, Did you do some change in the code?

@dabakix8
Copy link
Author

Hello, yrosascu-san

Honesty, it is not clear for me your present situation. You can communicate with ev3 via ssh? If yes, did you launch the provided launch file from your PC? I have not modificed any thing about launch file for ultrasonic.

To receive the data, you need to make one node to see the ultrasonic data. Did you do that? If yes, can I see your code? Launching ultrasonic sensor does not show data.

md

@valerybugakov
Copy link

valerybugakov commented May 1, 2017

@mdaiba Could share an example of your motor.launch file?
I'm trying to get motors work too using this package. I got Ev3InfraredController working but cannot figure out how to configure motors. If I have only one motor on PortA should I delete all the configuration about other ports and inputs from the config files?

Also how did you figure out how to control motor? Cannot find any info about that.

Thanks!

@valerybugakov
Copy link

@cyborg-x1 maybe you could share an example for motor.launch? Would appreciate that.

@cyborg-x1
Copy link
Member

Just remove the motor you do not want the controller for in the launchfile.
Here you probably see the connection:
OutPortA is a name freely definable by you. But inside the launchfile it points to the settings in the yaml file:

in motors.yaml
OutPortA:

type: velocity_controllers/JointVelocityController
joint: Joint_A

<node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false" output="screen" args="OutPortState OutPortA OutPortB "/>

So if you do not need OutportB:

<node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false" output="screen" args="OutPortState OutPortA "/>

@valerybugakov
Copy link

@cyborg-x1 thanks for explanation, is there a place where can I read about it or maybe a code block where it's parsed and used? I've jumped into ROS stuff a month ago, hopefully it's not very dumb questions :)

Btw thanks for the awesome project!

@cyborg-x1
Copy link
Member

cyborg-x1 commented May 2, 2017

You are welcome ;-)
You should read about ROS Control - thats the basic ros package/library behind ev3_manager

@yrosascu
Copy link

yrosascu commented May 3, 2017

mdaiba,
In my case, I still do not even get the movement of the motors, I guess the problem is the network configuration because it returns this:
Couldn't find an AF_INET address for [ieka]

But I configured it as I have been recommended in the issues, but so far it does not move.
I change hosts files as it says here: ros wiki but nothing.
Maybe do you have any idea?

Thanks for you help.

@cyborg-x1
Copy link
Member

cyborg-x1 commented May 3, 2017

Best thing to check first if you can rostopic pub and echo in both directions
Brick <-> PC
AF_INET sounds a bit like DNS errors and you have to set ROS_IP, for ROS I recommend having a DNS runnning, cause even if ROS_IP is set, your IP can change each time you connect to the network which would require updating ROS_IP again and again.
Get a router with OpenWRT or install a DHCP/DNS on one PC of your network.

@yrosascu
Copy link

yrosascu commented May 3, 2017

I reserved the IP's (brick and pc) in my router but i supposse that is my last option. My router don't have support in OpenWRT, can i use another firmware?
I have a TP-Link WR940N router.

Thanks for the suggestions.

@cyborg-x1
Copy link
Member

the DNS is the Key...
OpenWRT is a alternative Firmware for your Router. Be careful if you use it for Internet Access! I never tried that with OpenWRT.

It seems there is one for your Router:
https://wiki.openwrt.org/toh/tp-link/tl-wr940n

Otherwise you could create one with your computer:
https://www.linux.com/learn/dnsmasq-easy-lan-name-services

@dabakix8
Copy link
Author

dabakix8 commented May 7, 2017

yrosascu

Sometimes, I am confronted with same issue as you said.

Couldn't find an AF_INET address for xxxxxx

Please make sure with "printenv" that your ROS_IP and ROS_MASTER_URI are reflected before you run your script (*.py) or your launch file. I found sometimes I did misspel, sometimes the setting is deleted before running my script (weird).

When this issue is happen, re-run roscore and ev3_manager, and checking ROS_IP, ROS_MASTER_URI before running script is helping me. But I would like to check the route cause of this.

mdaiba

@cyborg-x1
Copy link
Member

Oh yeah, now that you say this, it could be that the script is not sourcing again after applying changes.

@rongfeng-china
Copy link

rongfeng-china commented Jun 10, 2018

Hi, guys... I followed this instruction, but still got the error “[ERROR] [1528615186.304805597]: Waiting for rosmaster” "Couldn't find an AF_INET address for [http]" in lego ev3.

I followed this [tutorial] (http://hacks4ros.github.io/h4r_ev3_ctrl/index.html#GettingStarted) until the end of [First steps for setting Wireless.], and I connected lego and computer with USB cable successfully.
My computer IP: 192.168.10.2
My lego IP: 192.168.10.123
screenshot from 2018-06-10 01-24-31

I'm able to ping from lego to computer and ping from computer to lego, so network is working.

What could be the problem? Many thanks!!

@cyborg-x1
Copy link
Member

I guess again a problem with DNS.
check for ROS_IP in ROS Documentation.
Have you set ROS_IP on your computer to your computers IP?
export ROS_IP=192.168.10.2

(need to do in every terminal you want to start a process to connect to the Brick. If you have a fixed IP for your computer in the network, it can go in the bashrc next to source /opt/ros/version/setup.bash)

Or you need local DNS in your Network...

See also, first result for search terms: ROS AF_INET on Google...

https://answers.ros.org/question/163556/how-to-solve-couldnt-find-an-af_inet-address-for-problem/

@rongfeng-china
Copy link

rongfeng-china commented Jun 27, 2018

Thanks, my lego can connect with PC with USB cable. I also wrote some scripts to control the motors. They are working well now. Thank you!! I have another problem recently, it would be great if you can have a look below.
//------------------------------------------------------------------------------------------------------------------------------
I'm considering to use wifi rather than USB for connection. However, neither of these two adaptors can work: 1. Realtek Semiconductor Corp. RTL8191SU 802.11n WLAN Adapter 2. Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter.
I checked with 'lsusb' and the device can be detected. However 'ifconfig' does not show the wifi infomation.
screenshot from 2018-06-26 22-44-55

I also tried to install the driver for rtl8191, but it seems very tedious and not successful. Have you tried wifi connection, and could you give some more explanations? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants