RESTAPI [/ros/flytsim/navigation/velocity_set] not working neither in browser nor through App


#1

Hello,

The velocity set api gives me the error 404 resource not found. But the position set api works fine. Please check the following screen shot.

Thanks



#2

Pratik,

The velocity set api has a variable yaw_rate_valid instead of yaw_valid . yaw_valid is only for position set api.


#3

Vallabh,

I have change the parameter from yaw_valid to yaw_rate_valid but still getting the same response code 404 resource not found.

Thanks.


#4

Pratik,
The 404 not found error happens if there is an error in the url or the server is not available.
check if you get anything on running 10.0.1.108:9090/ros/get_global_namespace. if not check the link(ip) or restart flytos. it works for me.



#5

Vallabh,

The api get global namespace is working fine getting the namespace, also the api position set is also working fine.
But I don’t understand where is the issue in velocity set api which gives response 404. I have also change the parameters as per your suggestion but still the issue remains the same.

Thanks.





#6

pratik,
Try updating your flytsim to the latest version available . The server of your version of flytsim does not have the provision to serve any requests regarding velocity_set


#7

Vallabh,

I have updated the flytsim to the latest version i.e flytsimv0.2.

The problem is the get global namespace api gives me response status 0. Can you help me out why the get global namespace and other api stopped working.

Thanks.



#8

pratik,
The namespace spelling is wrong
Youve written get_global_namesapce

It should be get_global_namespace


#9

Vallabh,

I have corrected the spelling mistake and again check the service response, still gives the same response 0.

I think you have also got the same response, as the previous screenshot share by you, the history section shows the same things that I am facing.

Thanks.


#10

pratik,
Most probably your server has crashed due to improper rest calls. so restart flytos and try again.


#11

Vallabh,

I have restarted the simulator two to three times.
When api command is fire through the terminal the simulator gives successful response. So I don’t think the issue is regarding the server getting crash. As the get global namespace command gives the namespace in the terminal, but gives response 0 through the browser.

Thanks.


#12

Pratik,
If the commands work through the terminal it means that flytos is working which will still work if the server has crashed. If server crashes sometimes the port remains occupied even after killing the flytos and you wont be allowed to use the port.
so for starters check if u get “welcome to flyt” page when you enter :9090 in address bar. if nothing then kill your flytos .
then open a new terminal and type . netstat -ap | grep :9090
You will get a list containing what is using your 9090 network port … you will need to kill those processes.

For that look something like /python in the list
the number denotes the process id.
sudo kill -9

then run the netstat command again and you should see no list.

then start the flytos


#13

Vallabh,

I run the following command in the terminal when the flytsim was up, I got following response

pratik@pratik-VirtualBox:~$ netstat -ap |grep :9090(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
pratik@pratik-VirtualBox:~$

It seems that port 9090 is not assign to server, I try to check on which port the flytos is running by the following command
but does not get any idea. Following is the command and its result

pratik@pratik-VirtualBox:~$ netstat -tulpn(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:40749 0.0.0.0:* LISTEN 2637/commander
tcp 0 0 0.0.0.0:39534 0.0.0.0:* LISTEN 3133/gzclient
tcp 0 0 0.0.0.0:33326 0.0.0.0:* LISTEN 2321/navigation_ser
tcp 0 0 0.0.0.0:47598 0.0.0.0:* LISTEN 2321/navigation_ser
tcp 0 0 0.0.0.0:40783 0.0.0.0:* LISTEN 3134/gzserver
tcp 0 0 0.0.0.0:45775 0.0.0.0:* LISTEN 2335/python
tcp 0 0 0.0.0.0:42383 0.0.0.0:* LISTEN 3290/mavros_node
tcp 0 0 0.0.0.0:37583 0.0.0.0:* LISTEN 2689/mc_mixer
tcp 0 0 0.0.0.0:11311 0.0.0.0:* LISTEN 2229/python
tcp 0 0 0.0.0.0:45776 0.0.0.0:* LISTEN 2996/mc_pos_control
tcp 0 0 0.0.0.0:36208 0.0.0.0:* LISTEN 2338/navigation_api
tcp 0 0 0.0.0.0:42097 0.0.0.0:* LISTEN 3134/gzserver
tcp 0 0 0.0.0.0:11345 0.0.0.0:* LISTEN 3134/gzserver
tcp 0 0 0.0.0.0:42130 0.0.0.0:* LISTEN 2829/rosout
tcp 0 0 0.0.0.0:35795 0.0.0.0:* LISTEN 2417/mode_manager
tcp 0 0 0.0.0.0:43827 0.0.0.0:* LISTEN 2330/setup_api
tcp 0 0 0.0.0.0:39507 0.0.0.0:* LISTEN 2210/python
tcp 0 0 0.0.0.0:49493 0.0.0.0:* LISTEN 2338/navigation_api
tcp 0 0 127.0.1.1:53 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:46198 0.0.0.0:* LISTEN 2593/rosout
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:46616 0.0.0.0:* LISTEN 2732/attitude_estim
tcp 0 0 0.0.0.0:55609 0.0.0.0:* LISTEN 3134/gzserver
tcp 0 0 0.0.0.0:35609 0.0.0.0:* LISTEN 2335/python
tcp 0 0 0.0.0.0:45817 0.0.0.0:* LISTEN 2417/mode_manager
tcp 0 0 0.0.0.0:35450 0.0.0.0:* LISTEN 3092/mavlink
tcp 0 0 0.0.0.0:40893 0.0.0.0:* LISTEN 3092/mavlink
tcp 0 0 0.0.0.0:34877 0.0.0.0:* LISTEN 2637/commander
tcp 0 0 0.0.0.0:57310 0.0.0.0:* LISTEN 3290/mavros_node
tcp 0 0 0.0.0.0:43038 0.0.0.0:* LISTEN 2912/mc_att_control
tcp 0 0 0.0.0.0:59422 0.0.0.0:* LISTEN 2732/attitude_estim
tcp 0 0 0.0.0.0:41087 0.0.0.0:* LISTEN 2689/mc_mixer
tcp 0 0 0.0.0.0:41696 0.0.0.0:* LISTEN 2912/mc_att_control
tcp 0 0 0.0.0.0:33058 0.0.0.0:* LISTEN 2325/param_api
tcp 0 0 0.0.0.0:42469 0.0.0.0:* LISTEN 2829/rosout
tcp 0 0 0.0.0.0:44390 0.0.0.0:* LISTEN 2212/python
tcp 0 0 0.0.0.0:42151 0.0.0.0:* LISTEN 2996/mc_pos_control
tcp 0 0 0.0.0.0:35879 0.0.0.0:* LISTEN 2325/param_api
tcp 0 0 0.0.0.0:36777 0.0.0.0:* LISTEN 2784/position_estim
tcp 0 0 0.0.0.0:48777 0.0.0.0:* LISTEN 2330/setup_api
tcp 0 0 0.0.0.0:51946 0.0.0.0:* LISTEN 2784/position_estim
tcp 0 0 0.0.0.0:41162 0.0.0.0:* LISTEN 2593/rosout
tcp 0 0 0.0.0.0:38699 0.0.0.0:* LISTEN 2311/navigation_ser
tcp 0 0 0.0.0.0:50763 0.0.0.0:* LISTEN 2311/navigation_ser
tcp6 0 0 ::1:631 :::* LISTEN -
udp 0 0 0.0.0.0:5353 0.0.0.0:* -
udp 0 0 0.0.0.0:46567 0.0.0.0:* 2784/position_estim
udp 0 0 0.0.0.0:44545 0.0.0.0:* 2321/navigation_ser
udp 0 0 0.0.0.0:50731 0.0.0.0:* -
udp 0 0 0.0.0.0:57269 0.0.0.0:* 2325/param_api
udp 0 0 0.0.0.0:38865 0.0.0.0:* 2338/navigation_api
udp 0 0 0.0.0.0:57377 0.0.0.0:* 3092/mavlink
udp 0 0 0.0.0.0:43061 0.0.0.0:* 2311/navigation_ser
udp 0 0 127.0.1.1:53 0.0.0.0:* -
udp 0 0 0.0.0.0:41026 0.0.0.0:* 3134/gzserver
udp 0 0 0.0.0.0:68 0.0.0.0:* -
udp 0 0 127.0.0.1:14560 0.0.0.0:* 3290/mavros_node
udp 0 0 127.0.0.1:14565 0.0.0.0:* 3092/mavlink
udp 0 0 0.0.0.0:53505 0.0.0.0:* 2996/mc_pos_control
udp 0 0 0.0.0.0:43293 0.0.0.0:* -
udp 0 0 0.0.0.0:55666 0.0.0.0:* 3290/mavros_node
udp 0 0 0.0.0.0:59796 0.0.0.0:* 2637/commander
udp 0 0 0.0.0.0:33207 0.0.0.0:* 2417/mode_manager
udp 0 0 0.0.0.0:631 0.0.0.0:* -
udp 0 0 0.0.0.0:37500 0.0.0.0:* 2732/attitude_estim
udp 0 0 0.0.0.0:60108 0.0.0.0:* 2593/rosout
udp 0 0 0.0.0.0:53996 0.0.0.0:* 2689/mc_mixer
udp 0 0 0.0.0.0:50162 0.0.0.0:* 2829/rosout
udp 0 0 0.0.0.0:37978 0.0.0.0:* 2912/mc_att_control
udp 0 0 0.0.0.0:38091 0.0.0.0:* 2330/setup_api
udp6 0 0 :::5353 :::* -
udp6 0 0 :::21120 :::* -
udp6 0 0 :::33646 :::* -

Can you guide me out where the thing is going wrong.
Thanks.


#14

pratik,
sometimes netstat gives that error. use this command

lsof -i :9090

if you want to see if the port 9090 usedby flytos is in use run this command after shutting down flytos.


#15

vallabh,

I have run the command but it does not provide any information. Please see the screen shot of the terminal.

Thanks.



#16

Pratik,

If there is nothing displayed means the port is not in use .
You can try using the flytos now and test your rest calls.


#17

vallabh,

I have start the flytsim simulator, its been up. Now when I run the command lsof -i :9090, it doesn’t show any information regarding the port 9090 is occupied by flytos or not.
When I call 10.0.1.108:9090 I am getting unable to connect message in the browser.
Does flytos is running on some other port than 9090?

Thanks.


#18

okay

For some reason your server is unable to start

SO now kill the flytos
open a new terminal
Start it again and when you press enter you will see a bunch of commands flowing .
In that if you see some red commands scroll up and see if it says “rostful died”

send me a screen shot


#19

vallabh,

The flytos server is up, as I rstarted the flytos server its starts working. But there is an issue that I am facing now, when I call api from browser or from app its gives me successful response. But after it donen’t respond to any api.

i.e first I call the take off api it gives successful response , but then I call the land api it doesn’t response.

Below is the screen shot after first time api is been called



#20

Pratik,

Takeoff is currently a synchronous call …so after pressing takeoff there would be no response till the take off is complete to the provided height… After the takeoff is complete flytos will receive and respond to all rest calls