Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
ros2rag
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
JastAdd
ros2rag
Commits
d921e51f
Commit
d921e51f
authored
4 years ago
by
René Schöne
Browse files
Options
Downloads
Patches
Plain Diff
Always specify topic and position in sender-stub.
parent
a966bb62
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ros2rag.senderstub/src/main/java/de/tudresden/inf/st/ros2rag/senderstub/Main.java
+14
-27
14 additions, 27 deletions
...ain/java/de/tudresden/inf/st/ros2rag/senderstub/Main.java
with
14 additions
and
27 deletions
ros2rag.senderstub/src/main/java/de/tudresden/inf/st/ros2rag/senderstub/Main.java
+
14
−
27
View file @
d921e51f
...
...
@@ -7,34 +7,21 @@ import java.util.concurrent.TimeUnit;
public
class
Main
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
final
String
topic
;
final
byte
[]
message
;
if
(
args
.
length
<
1
)
{
topic
=
"robot/joint1"
;
}
else
{
topic
=
args
[
0
];
}
if
(
args
.
length
<
2
)
{
Linkstate
.
PandaLinkState
pls
=
Linkstate
.
PandaLinkState
.
newBuilder
()
.
setName
(
"Joint1"
)
.
setPos
(
Linkstate
.
PandaLinkState
.
Position
.
newBuilder
()
.
setPositionX
(
0.5f
)
.
setPositionY
(
0.5f
)
.
setPositionZ
(
0.5f
)
.
build
())
.
setOrient
(
Linkstate
.
PandaLinkState
.
Orientation
.
newBuilder
()
.
setOrientationX
(
0
)
.
setOrientationY
(
0
)
.
setOrientationZ
(
0
)
.
setOrientationW
(
0
)
.
build
())
.
build
();
message
=
pls
.
toByteArray
();
}
else
{
message
=
args
[
1
].
getBytes
();
// assume 4 arguments
if
(
args
.
length
<
4
)
{
System
.
err
.
println
(
"Sends a new position, expected arguments: topic x y z"
);
return
;
}
final
String
topic
=
args
[
0
];
Linkstate
.
PandaLinkState
pls
=
Linkstate
.
PandaLinkState
.
newBuilder
()
.
setName
(
args
[
0
])
.
setPos
(
Linkstate
.
PandaLinkState
.
Position
.
newBuilder
()
.
setPositionX
(
Float
.
parseFloat
(
args
[
1
]))
.
setPositionY
(
Float
.
parseFloat
(
args
[
2
]))
.
setPositionZ
(
Float
.
parseFloat
(
args
[
3
]))
.
build
())
.
build
();
final
byte
[]
message
=
pls
.
toByteArray
();
MqttUpdater
sender
=
new
MqttUpdater
(
"sender stub"
).
dontSendWelcomeMessage
();
sender
.
setHost
(
"localhost"
,
1883
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment