Replies: 1 comment 5 replies
-
so I used the following code : package main
import (
"fmt"
"github.com/aler9/goroslib"
"github.com/aler9/goroslib/pkg/msgs/sensor_msgs"
)
func onMessage(msg *sensor_msgs.BatteryState) {
fmt.Printf("Incoming: %+v\n", msg)
}
func main() {
// create a node and connect to the master
n, err := goroslib.NewNode(goroslib.NodeConf{
Name: "goroslib_sub",
MasterAddress: "192.168.0.22:11311",
})
if err != nil {
panic(err)
}
defer n.Close()
sub, err := goroslib.NewSubscriber(goroslib.SubscriberConf{
Node: n,
Topic: "/mavros/battery",
Callback: onMessage,
// Protocol: goroslib.UDP,
})
if err != nil {
panic(err)
}
defer sub.Close()
// freeze main loop
select {}
} so I run this code from the raspberry pi, topics are not updated. it's just bugging me, I can't understand how is this possible :/ any thoughts ? |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I use the goroslib with mavros on arducopter.
I'm having a weird issue and i'm hoping you could provide some guidance, so here's what's happening:
I'm running a SITL (simulator) on virtualbox along with a mavros master node. I use the following launch file to run with roslaunch:
Then I connect my goroslib program with the master node and read topics etc .... this usually works.
Now sometimes when I change my local network (and go to a friend's house for example), my goroslib connects to the master node without any issues, but no topic is triggered ... nothing happens....
I tried to run the goroslib program from my raspberrypi for example and connect to the master node ... nothing happens ... topics are empty ...
Would you have any idea why this could happen ?
Thank you !
Beta Was this translation helpful? Give feedback.
All reactions